diff mercurial/changegroup.py @ 25677:af5b2f4ed594 stable

changegroup: properly compute common base in changeggroupsubset (issue4736) The computation of roots was buggy, any ancestor of a bundled merge which was also a descendant of the parents of a bundled revision were included as part of the bundle. We fix it and add a test for strip (which revealed the problem). Check the test for a practical usecase.
author Pierre-Yves David <pierre-yves.david@fb.com>
date Mon, 29 Jun 2015 11:20:09 -0700
parents 90f2b9de30f2
children ce3d4b858420
line wrap: on
line diff
--- a/mercurial/changegroup.py	Thu Jun 25 22:07:38 2015 +0900
+++ b/mercurial/changegroup.py	Mon Jun 29 11:20:09 2015 -0700
@@ -577,11 +577,13 @@
     cl = repo.changelog
     if not roots:
         roots = [nullid]
-    # TODO: remove call to nodesbetween.
-    csets, roots, heads = cl.nodesbetween(roots, heads)
     discbases = []
     for n in roots:
         discbases.extend([p for p in cl.parents(n) if p != nullid])
+    # TODO: remove call to nodesbetween.
+    csets, roots, heads = cl.nodesbetween(roots, heads)
+    included = set(csets)
+    discbases = [n for n in discbases if n not in included]
     outgoing = discovery.outgoing(cl, discbases, heads)
     bundler = packermap[version][0](repo)
     return getsubset(repo, outgoing, bundler, source, version=version)