Mercurial > hg
changeset 18511:798ab869b2ee stable
share: backout fd903f89e42b, except the test
Locating the share source when no default path is available is now handled in
subrepo._abssource(), so unconditionally setting a default path (and the
associated problems) can be avoided.
The test change reflects the fact that a default path is no longer set on the
resulting share.
author | Matt Harbison <matt_harbison@yahoo.com> |
---|---|
date | Tue, 27 Nov 2012 21:31:59 -0500 |
parents | f254ab6207ae |
children | 22978b82ab4b |
files | mercurial/hg.py tests/test-subrepo.t |
diffstat | 2 files changed, 7 insertions(+), 12 deletions(-) [+] |
line wrap: on
line diff
--- a/mercurial/hg.py Tue Nov 27 20:56:27 2012 -0500 +++ b/mercurial/hg.py Tue Nov 27 21:31:59 2012 -0500 @@ -171,14 +171,11 @@ r = repository(ui, root) default = srcrepo.ui.config('paths', 'default') - if not default: - # set default to source for being able to clone subrepos - default = os.path.abspath(util.urllocalpath(origsource)) - fp = r.opener("hgrc", "w", text=True) - fp.write("[paths]\n") - fp.write("default = %s\n" % default) - fp.close() - r.ui.setconfig('paths', 'default', default) + if default: + fp = r.opener("hgrc", "w", text=True) + fp.write("[paths]\n") + fp.write("default = %s\n" % default) + fp.close() if update: r.ui.status(_("updating working directory\n"))
--- a/tests/test-subrepo.t Tue Nov 27 20:56:27 2012 -0500 +++ b/tests/test-subrepo.t Tue Nov 27 21:31:59 2012 -0500 @@ -726,10 +726,8 @@ $ test -f ../shared/subrepo-1/.hg/sharedpath [1] $ hg -R ../shared in - comparing with $TESTTMP/subrepo-status (glob) - searching for changes - no changes found - [1] + abort: repository default not found! + [255] $ hg -R ../shared/subrepo-2 showconfig paths paths.default=$TESTTMP/subrepo-status/subrepo-2 $ hg -R ../shared/subrepo-1 sum --remote