Show More
@@ -5232,12 +5232,23 b' def root(ui, repo, **opts):' | |||||
5232 |
|
5232 | |||
5233 | Print the root directory of the current repository. |
|
5233 | Print the root directory of the current repository. | |
5234 |
|
5234 | |||
|
5235 | .. container:: verbose | |||
|
5236 | ||||
|
5237 | Template: | |||
|
5238 | ||||
|
5239 | The following keywords are supported in addition to the common template | |||
|
5240 | keywords and functions. See also :hg:`help templates`. | |||
|
5241 | ||||
|
5242 | :hgpath: String. Path to the .hg directory. | |||
|
5243 | :storepath: String. Path to the directory holding versioned data. | |||
|
5244 | ||||
5235 | Returns 0 on success. |
|
5245 | Returns 0 on success. | |
5236 | """ |
|
5246 | """ | |
5237 | opts = pycompat.byteskwargs(opts) |
|
5247 | opts = pycompat.byteskwargs(opts) | |
5238 | with ui.formatter('root', opts) as fm: |
|
5248 | with ui.formatter('root', opts) as fm: | |
5239 | fm.startitem() |
|
5249 | fm.startitem() | |
5240 | fm.write('reporoot', '%s\n', repo.root) |
|
5250 | fm.write('reporoot', '%s\n', repo.root) | |
|
5251 | fm.data(hgpath=repo.path, storepath=repo.spath) | |||
5241 |
|
5252 | |||
5242 | @command('serve', |
|
5253 | @command('serve', | |
5243 | [('A', 'accesslog', '', _('name of access log file to write to'), |
|
5254 | [('A', 'accesslog', '', _('name of access log file to write to'), |
@@ -101,7 +101,9 b' Repository root:' | |||||
101 | $ hg root -Tjson | sed 's|\\\\|\\|g' |
|
101 | $ hg root -Tjson | sed 's|\\\\|\\|g' | |
102 | [ |
|
102 | [ | |
103 | { |
|
103 | { | |
104 |
" |
|
104 | "hgpath": "$TESTTMP/t/.hg", | |
|
105 | "reporoot": "$TESTTMP/t", | |||
|
106 | "storepath": "$TESTTMP/t/.hg/store" | |||
105 | } |
|
107 | } | |
106 | ] |
|
108 | ] | |
107 |
|
109 |
@@ -719,6 +719,14 b' Test clone from the repository in (emula' | |||||
719 | $ hg -R src debugrevlog -c | egrep 'format|flags' |
|
719 | $ hg -R src debugrevlog -c | egrep 'format|flags' | |
720 | format : 0 |
|
720 | format : 0 | |
721 | flags : (none) |
|
721 | flags : (none) | |
|
722 | $ hg root -R src -T json | sed 's|\\\\|\\|g' | |||
|
723 | [ | |||
|
724 | { | |||
|
725 | "hgpath": "$TESTTMP/src/.hg", | |||
|
726 | "reporoot": "$TESTTMP/src", | |||
|
727 | "storepath": "$TESTTMP/src/.hg" | |||
|
728 | } | |||
|
729 | ] | |||
722 | $ hg clone -U -q src dst |
|
730 | $ hg clone -U -q src dst | |
723 | $ hg -R dst log -q |
|
731 | $ hg -R dst log -q | |
724 | 0:e1bab28bca43 |
|
732 | 0:e1bab28bca43 |
@@ -21,6 +21,14 b" share shouldn't have a store dir" | |||||
21 | $ cd repo2 |
|
21 | $ cd repo2 | |
22 | $ test -d .hg/store |
|
22 | $ test -d .hg/store | |
23 | [1] |
|
23 | [1] | |
|
24 | $ hg root -Tjson | sed 's|\\\\|\\|g' | |||
|
25 | [ | |||
|
26 | { | |||
|
27 | "hgpath": "$TESTTMP/repo2/.hg", | |||
|
28 | "reporoot": "$TESTTMP/repo2", | |||
|
29 | "storepath": "$TESTTMP/repo1/.hg/store" | |||
|
30 | } | |||
|
31 | ] | |||
24 |
|
32 | |||
25 | share shouldn't have a full cache dir, original repo should |
|
33 | share shouldn't have a full cache dir, original repo should | |
26 |
|
34 |
General Comments 0
You need to be logged in to leave comments.
Login now