bundlerepo: don't return the peer without bundlerepo from getremotechanges stable
authorMads Kiilerich <madski@unity3d.com>
Fri, 28 Dec 2012 11:16:01 +0100
branchstable
changeset 18138 8ab0640c3090
parent 18122 730b769fb634
child 18139 03faf12fbee7
bundlerepo: don't return the peer without bundlerepo 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. The 'other' could be a http peer which only implement the functionality available over the http protocol. Transplant could thus fail with TypeError: argument of type 'httppeer' is not iterable Solution: Return the local repo instead of the remote peer if there is no reason to place a bundlerepo on top of the local repo.
mercurial/bundlerepo.py
tests/test-transplant.t
--- a/mercurial/bundlerepo.py	Mon Dec 24 13:26:13 2012 +0100
+++ b/mercurial/bundlerepo.py	Fri Dec 28 11:16:01 2012 +0100
@@ -347,7 +347,7 @@
                 os.unlink(bundlename)
         except OSError:
             pass
-        return other, [], other.close
+        return repo, [], other.close
 
     bundle = None
     bundlerepo = None
--- a/tests/test-transplant.t	Mon Dec 24 13:26:13 2012 +0100
+++ b/tests/test-transplant.t	Fri Dec 28 11:16:01 2012 +0100
@@ -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