[PATCH stable] bundlerepo: return more capable repos from getremotechanges

Mads Kiilerich kiilerix at gmail.com
Mon Dec 17 08:36:53 CST 2012


# HG changeset patch
# User Mads Kiilerich <madski at unity3d.com>
# Date 1355754680 -3600
# Branch stable
# Node ID 01729f368344a926b8d9a45cff5fbfc129a8aa94
# Parent  777084ac84167e3bdea45b5c00de1106cca36eef
bundlerepo: return more capable repos from getremotechanges

Problem:
getremotechanges would return the 'other' repo if nothing was incoming and
there thus wasn't any bundle to base the repo on. That could be a problem
because a remote peer is less capable than a bundlerepo. That showed up as a
crash in transplant.

Solution:
Return the local repo instead of the remote peer.

diff --git a/mercurial/bundlerepo.py b/mercurial/bundlerepo.py
--- a/mercurial/bundlerepo.py
+++ b/mercurial/bundlerepo.py
@@ -347,7 +347,7 @@
                 os.unlink(bundlename)
         except OSError:
             pass
-        return other, [], other.close
+        return repo, [], repo.close
 
     bundle = None
     bundlerepo = None
diff --git a/tests/test-transplant.t b/tests/test-transplant.t
--- a/tests/test-transplant.t
+++ b/tests/test-transplant.t
@@ -288,6 +288,15 @@
   1  b1
   0  r1
 
+remote transplant without pull
+
+  $ hg pull -q http://localhost:$HGPORT/
+  $ hg transplant -s http://localhost:$HGPORT/ 2 4
+  searching for changes
+  skipping already applied revision 2:8d9279348abb
+  applying 722f4667af76
+  722f4667af76 transplanted to 76e321915884
+
 transplant --continue
 
   $ hg init ../tc


More information about the Mercurial-devel mailing list