# HG changeset patch # User Mads Kiilerich # Date 2012-12-28 10:16:01 # Node ID 8ab0640c309081119a26cce8cf9b50e2551dfb18 # Parent 730b769fb6347d8da3c9e0674e7133bdf61d7a36 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. diff --git a/mercurial/bundlerepo.py b/mercurial/bundlerepo.py --- a/mercurial/bundlerepo.py +++ b/mercurial/bundlerepo.py @@ -347,7 +347,7 @@ def getremotechanges(ui, repo, other, on os.unlink(bundlename) except OSError: pass - return other, [], other.close + return repo, [], other.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 @@ remote transplant with pull 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