Patchwork [2,of,2,STABLE] share: backout fd903f89e42b, except the test

login
register
mail settings
Submitter Matt Harbison
Date Jan. 30, 2013, 3:26 a.m.
Message ID <e36510b2612f02adbdc4.1359516419@Envy>
Download mbox | patch
Permalink /patch/761/
State Accepted
Commit 798ab869b2eef863e46a66f9a6bbbfb265991035
Headers show

Comments

Matt Harbison - Jan. 30, 2013, 3:26 a.m.
# HG changeset patch
# User Matt Harbison <matt_harbison@yahoo.com>
# Date 1354069919 18000
# Branch stable
# Node ID e36510b2612f02adbdc4b6e80df3735af204e5ff
# Parent  8032309101bf203cbef6ae46abdf81be86c9fd8b
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.
Matt Mackall - Jan. 31, 2013, 5:33 a.m.
On Tue, 2013-01-29 at 22:26 -0500, Matt Harbison wrote:
> # HG changeset patch
> # User Matt Harbison <matt_harbison@yahoo.com>
> # Date 1354069919 18000
> # Branch stable
> # Node ID e36510b2612f02adbdc4b6e80df3735af204e5ff
> # Parent  8032309101bf203cbef6ae46abdf81be86c9fd8b
> share: backout fd903f89e42b, except the test

Thanks, queued for stable.

Patch

diff --git a/mercurial/hg.py b/mercurial/hg.py
--- a/mercurial/hg.py
+++ b/mercurial/hg.py
@@ -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"))
diff --git a/tests/test-subrepo.t b/tests/test-subrepo.t
--- a/tests/test-subrepo.t
+++ b/tests/test-subrepo.t
@@ -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