MultipleRepository
- https://twitter.com/mittyorz/status/21069493593706496
- マルチリポジトリの時って、authz_module_nameはどうなるんだろう。整合性がとれない気がするんだが…
- https://twitter.com/mittyorz/status/21079250299781121
- 複数のリポジトリを、マルチリポジトリ機能を使って一つのtracでリポジトリブラウザから見るとき、各リポジトリを列挙するのと、そのリポジトリ達の中のデフォルトのリポジトリを表示するのは、排他なんだな…
- .hidden = true について
要検証。=> #a0.12vs0.12.1
- 複数のリポジトリを、マルチリポジトリ機能を使って一つのtracでリポジトリブラウザから見るとき、各リポジトリを列挙するのと、そのリポジトリ達の中のデフォルトのリポジトリを表示するのは、排他なんだな…
- https://twitter.com/mittyorz/status/21079947758014464
- 「.alias = hogehoge」しないと、一番最初に記述されたのがデフォルトのリポジトリと見なされるのかな
- デフォルトのリポジトリ(「.alias = hogehoge」)は、svn-hookを使わなくてもsyncされる
- デフォルトのリポジトリを、マルチリポジトリの他のリポジトリに(trac.iniで)切り替えると、(trac-adminなしで)up-to-dateになる
0.12 vs 0.12.1
- 「規定のリポジトリ」の表示のされ方が、Trac 0.12とTrac 0.12.1で異なる
- trac.ini
[repositories] hoXXXXX.dir = /var/svn/-----/hoXXXXX hoXXXXX.type = svn hoXXXXX.url = https://ubuntu64/svn/hoXXXXX/ paYYYYYY.dir = /var/svn/-----/paYYYYYY paYYYYYY.type = svn paYYYYYY.url = https://ubuntu64/svn/paYYYYYY/ s0ZZZZZZZ.dir = /var/svn/-----/s0ZZZZZZZ s0ZZZZZZZ.type = svn s0ZZZZZZZ.url = https://ubuntu64/svn/s0ZZZZZZZ/ woXYZXYZXYZ.dir = /var/svn/-----/woXYZXYZXYZ woXYZXYZXYZ.type = svn woXYZXYZXYZ.url = https://ubuntu64/svn/woXYZXYZXYZ/ .alias = paYYYYYY
Migration from a single-repository setup
before migration
- 4 repositories and 2 tracs
- ls -ld /var/svn/lab/*
drwxr-x--x 7 root www-data 90 2010-09-19 11:31 /var/svn/lab/lab drwxr-x--x 7 root www-data 90 2011-01-02 19:02 /var/svn/lab/lab.test drwxr-x--x 7 root www-data 90 2010-12-16 16:37 /var/svn/lab/test drwxr-x--x 7 root www-data 90 2010-12-19 22:45 /var/svn/lab/test2
- ls -ld /var/trac/lab/*
drwxr-x--x 9 root www-data 124 2009-06-04 16:14 /var/trac/lab/lab drwxr-x--x 9 root www-data 124 2010-12-16 17:02 /var/trac/lab/test
- ls -ld /var/svn/lab/*
step by step
- remove "repository_dir" from trac.ini
- diff -u /var/trac/lab/test/conf/trac.ini.20110101 /var/trac/lab/test/conf/trac.ini
-
/var/trac/lab/test/conf/trac.ini
old new 14 14 [trac] 15 15 authz_file = /path/to/config/files/passwd/svn-authz.lab 16 16 authz_module_name = test 17 repository_dir = /var/svn/lab/test
-
- Tracのリポジトリブラウザとタイムラインから、エントリが消える
- diff -u /var/trac/lab/test/conf/trac.ini.20110101 /var/trac/lab/test/conf/trac.ini
- add "[repositories]" to trac.ini
- diff -u /var/trac/lab/test/conf/trac.ini.20110101 /var/trac/lab/test/conf/trac.ini
-
/var/trac/lab/test/conf/trac.ini
old new 11 11 name = test 12 12 url = https://lab.mitty.jp/trac/test/ 13 13 14 [repositories] 15 lab.test.dir = /var/svn/lab/lab.test 16 lab.test.type = svn 17 lab.test.url = http://lab.mitty.jp/svn/lab.test/ 18 test.dir = /var/svn/lab/test 19 test.type = svn 20 test.url = http://lab.mitty.jp/svn/test/ 21 test2.dir = /var/svn/lab/test2 22 test2.type = svn 23 test2.url = http://lab.mitty.jp/svn/test2/ 24 14 25 [trac] 15 26 authz_file = /path/to/config/files/passwd/svn-authz.lab 16 27 authz_module_name = test 17 repository_dir = /var/svn/lab/test
-
- resyncするまではリポジトリの情報が見れない
- diff -u /var/trac/lab/test/conf/trac.ini.20110101 /var/trac/lab/test/conf/trac.ini
- resync repositories
- sudo trac-admin /var/trac/lab/test/ repository resync "*"
Resyncing repository history for lab.test... 3 revisions cached. Resyncing repository history for test... 4 revisions cached. Resyncing repository history for test2... 2 revisions cached. Done.
- sudo trac-admin /var/trac/lab/test/ repository resync "*"
- add ".alias = lab.test" to trac.ini
- diff -u /var/trac/lab/test/conf/trac.ini.20110101 /var/trac/lab/test/conf/trac.ini
--- /var/trac/lab/test/conf/trac.ini.20110101 2011-01-01 15:24:22.593393957 +0900 +++ /var/trac/lab/test/conf/trac.ini 2011-01-02 23:00:13.925906625 +0900 @@ -11,7 +11,19 @@ name = test url = https://lab.mitty.jp/trac/test/ +[repositories] (snip) +test2.url = http://lab.mitty.jp/svn/test2/ + +.alias = lab.test + [trac] (snip)
- 「規定のリポジトリ」が表示される
- revisionも「4」に更新される
- 「/trunk」でのアクセスが復活する
- diff -u /var/trac/lab/test/conf/trac.ini.20110101 /var/trac/lab/test/conf/trac.ini
- add ".hidden = true"
- diff -u /var/trac/lab/test/conf/trac.ini.20110101 /var/trac/lab/test/conf/trac.ini
--- /var/trac/lab/test/conf/trac.ini.20110101 2011-01-01 15:24:22.593393957 +0900 +++ /var/trac/lab/test/conf/trac.ini 2011-01-02 23:06:31.585907819 +0900 @@ -11,7 +11,20 @@ name = test url = https://lab.mitty.jp/trac/test/ +[repositories] (snip) + +.alias = lab.test +.hidden = true + [trac] (snip)
- 「規定のリポジトリ」が表示されなくなる
- 「/trunk」では、「規定のリポジトリ」の「/trunk」に今まで通りアクセスできる
- diff -u /var/trac/lab/test/conf/trac.ini.20110101 /var/trac/lab/test/conf/trac.ini
- change ".alias" to "test" from "lab.test"
- diff -u /var/trac/lab/test/conf/trac.ini.20110101 /var/trac/lab/test/conf/trac.ini
--- /var/trac/lab/test/conf/trac.ini.20110101 2011-01-01 15:24:22.593393957 +0900 +++ /var/trac/lab/test/conf/trac.ini 2011-01-02 23:08:53.633399243 +0900 @@ -11,7 +11,19 @@ name = test url = https://lab.mitty.jp/trac/test/ +[repositories] (snip) +test2.url = http://lab.mitty.jp/svn/test2/ + +.alias = test + [trac] (snip)
- ".alias"を変更することで「規定のリポジトリ」が変更される
- タイムラインには変化はない
- diff -u /var/trac/lab/test/conf/trac.ini.20110101 /var/trac/lab/test/conf/trac.ini
- add post-commit to each repositories and symlink trac environment
- sudo ln -s /path/to/config/files/svn/hooks/post-commit /var/svn/lab/lab/hooks/
- sudo ln -s /path/to/config/files/svn/hooks/post-commit /var/svn/lab/test/hooks/
- sudo ln -s /path/to/config/files/svn/hooks/post-commit /var/svn/lab/test2/hooks/
- sudo ln -s test /var/trac/lab/lab.test
- sudo ln -s test /var/trac/lab/test2
- ln -sを使って、post-commitが正常に「test」を更新できるようにする
- ls -ld /var/trac/lab/*
drwxr-x--x 9 root www-data 124 2009-06-04 16:14 /var/trac/lab/lab lrwxrwxrwx 1 root root 4 2011-01-03 23:28 /var/trac/lab/lab.test -> test drwxr-x--x 9 root www-data 124 2010-12-16 17:02 /var/trac/lab/test lrwxrwxrwx 1 root root 4 2011-01-03 23:28 /var/trac/lab/test2 -> test
- ls -ld /var/trac/lab/*
- 副作用として、「test」が三つ表示される
- /path/to/config/files/svn/hooks/post-commit
#!/bin/sh # POST-COMMIT HOOK # # The post-commit hook is invoked after a commit. Subversion runs # this hook by invoking a program (script, executable, binary, etc.) # named 'post-commit' (for which this file is a template) with the # following ordered arguments: # # [1] REPOS-PATH (the path to this repository) # [2] REV (the number of the revision just committed) # (snip) # Here is an example hook script, for a Unix /bin/sh interpreter. # For more examples and pre-written hooks, see those in # /usr/share/subversion/hook-scripts, and in the repository at # http://svn.collab.net/repos/svn/trunk/tools/hook-scripts/ and # http://svn.collab.net/repos/svn/trunk/contrib/hook-scripts/ REPOS="$1" REV="$2" # "$REPOS"/hooks/mailer.py commit "$REPOS" $REV "$REPOS"/mailer.conf PROJECT_NAME=`basename $REPOS` DIRNAME=`dirname $REPOS` SUB_ROOTDIR=`basename $DIRNAME` export PYTHON_EGG_CACHE="/tmp" export TRAC_ENV="/var/trac/${SUB_ROOTDIR}/${PROJECT_NAME}" /path/to/config/files/trac/contrib/trac-svn-hook $REPOS $REV
- /path/to/config/files/trac/contrib/trac-svn-hook
- add .tracignore
- sudo vim /path/to/config/files/trac/conf/lab.tracignore
.* lab.test test2
- sudo ln -s /path/to/config/files/trac/conf/lab.tracignore /var/trac/lab/.tracignore
- sudo vim /path/to/config/files/trac/conf/lab.tracignore
test post-commit
Last modified 14 years ago
Last modified on Mar 5, 2011 11:30:11 PM
Attachments (24)
-
svn-list.png
(47.9 KB) -
added by mitty 14 years ago.
subversion repository list
-
single-list.png
(35.4 KB) -
added by mitty 14 years ago.
trac environment list
-
single-browser.png
(50.5 KB) -
added by mitty 14 years ago.
trac browser with single repository
-
single-timeline.png
(54.6 KB) -
added by mitty 14 years ago.
trac timeline with single repository
-
rm-repository_dir-browser.png
(43.6 KB) -
added by mitty 14 years ago.
trac browser with repository_dir removed
-
rm-repository_dir-timeline.png
(54.8 KB) -
added by mitty 14 years ago.
trac timeline with repository_dir removed
-
add-[repositories]-browser.png
(47.4 KB) -
added by mitty 14 years ago.
trac browser with [repositories] added to trac.ini
-
resync-[repositories]-browser.png
(52.9 KB) -
added by mitty 14 years ago.
trac browser with resynced [repositories]
-
resync-[repositories]-trunk.png
(43.9 KB) -
added by mitty 14 years ago.
trac browser /trunk with resynced [repositories]
-
resync-[repositories]-timeline.png
(56.2 KB) -
added by mitty 14 years ago.
trac timeline with resynced [repositories]
-
no-change-on-commit.png
(52.1 KB) -
added by mitty 14 years ago.
no change found in trac browser on svn commit
-
add-.alias-browser.png
(61.3 KB) -
added by mitty 14 years ago.
trac browser with '.alias = ' added
-
add-.alias-trunk.png
(53.9 KB) -
added by mitty 14 years ago.
trac browser /trunk with '.alias = ' added
-
add-.alias_.hidden-browser.png
(56.5 KB) -
added by mitty 14 years ago.
trac browser with '.hidden = ' added
-
add-.alias_.hidden-trunk.png
(59.6 KB) -
added by mitty 14 years ago.
trac browser /trunk with '.hidden = ' added
-
change-.alias-browser.png
(59.3 KB) -
added by mitty 14 years ago.
trac browser with '.alias = ' changed
-
change-.alias-trunk.png
(58.9 KB) -
added by mitty 14 years ago.
trac browser /trunk with '.alias = ' changed
-
change-.alias-timeline.png
(60.1 KB) -
added by mitty 14 years ago.
trac timeline with '.alias = ' changed
-
trac-env-symlink-list.png
(43.0 KB) -
added by mitty 14 years ago.
trac environment list with symlink
-
tracignore.png
(43.6 KB) -
added by mitty 14 years ago.
trac environment list with symlink and .tracignore
-
updated-by-post-commit.png
(57.4 KB) -
added by mitty 14 years ago.
trac browser cache updated by svn post-commit hook script
-
browser-Trac-0.12.ja1.png
(63.8 KB) -
added by mitty 14 years ago.
TracBrowser with Trac 0.12.ja1
-
browser-Trac-0.12.1ja1.png
(57.4 KB) -
added by mitty 14 years ago.
TracBrowser with Trac 0.12.1.ja1
-
browser-Trac-0.12.ja1-hidden.png
(56.4 KB) -
added by mitty 14 years ago.
TracBrowser with Trac 0.12.ja1 and ".hidden = true"
Download all attachments as: .zip