diff mercurial/bundlerepo.py @ 23633:96c3cbec006f

incoming: handle phases the same as pull Now that bundlerepo can move phases safely, 'hg incoming' can share its phase handling code with pull to better reflect what would actually show up.
author Eric Sumner <ericsumner@fb.com>
date Thu, 18 Dec 2014 12:33:17 -0800
parents e7fcf58acd71
children 37a92908a382
line wrap: on
line diff
--- a/mercurial/bundlerepo.py	Thu Dec 18 12:22:43 2014 -0800
+++ b/mercurial/bundlerepo.py	Thu Dec 18 12:33:17 2014 -0800
@@ -350,6 +350,16 @@
         repopath, bundlename = parentpath, path
     return bundlerepository(ui, repopath, bundlename)
 
+class bundletransactionmanager(object):
+    def transaction(self):
+        return None
+
+    def close(self):
+        raise NotImplementedError
+
+    def release(self):
+        raise NotImplementedError
+
 def getremotechanges(ui, repo, other, onlyheads=None, bundlename=None,
                      force=False):
     '''obtains a bundle of changes incoming from other
@@ -418,6 +428,14 @@
 
     csets = localrepo.changelog.findmissing(common, rheads)
 
+    if bundlerepo:
+        reponodes = [ctx.node() for ctx in bundlerepo[bundlerepo.firstnewrev:]]
+        remotephases = other.listkeys('phases')
+
+        pullop = exchange.pulloperation(bundlerepo, other, heads=reponodes)
+        pullop.trmanager = bundletransactionmanager()
+        exchange._pullapplyphases(pullop, remotephases)
+
     def cleanup():
         if bundlerepo:
             bundlerepo.close()