Patchwork [3,of,9] shelve: really pass publicancestors to changegroupsubset - not the parents

login
register
mail settings
Submitter Mads Kiilerich
Date Feb. 10, 2014, 12:01 a.m.
Message ID <e021f2e5c5e4560025d3.1391990472@localhost.localdomain>
Download mbox | patch
Permalink /patch/3527/
State Accepted
Commit 3392695abd684b72700dc959dc0db667d91af508
Headers show

Comments

Mads Kiilerich - Feb. 10, 2014, 12:01 a.m.
# HG changeset patch
# User Mads Kiilerich <madski@unity3d.com>
# Date 1391989976 -3600
#      Mon Feb 10 00:52:56 2014 +0100
# Node ID e021f2e5c5e4560025d3c4056eb8b9c58bf1dc41
# Parent  0449c9dbf366ade29b6384f4d6e644095cd73bc5
shelve: really pass publicancestors to changegroupsubset - not the parents

publicancestors returned the parents of the public ancestors ... and
changegroupsubset used the parents of these as base for the bundle. That gave
bundles with one layer of changesets more than necessary.

Patch

diff --git a/hgext/shelve.py b/hgext/shelve.py
--- a/hgext/shelve.py
+++ b/hgext/shelve.py
@@ -122,22 +122,21 @@  def createcmd(ui, repo, pats, opts):
     """subcommand that creates a new shelve"""
 
     def publicancestors(ctx):
-        """Compute the heads of the public ancestors of a commit.
+        """Compute the public ancestors of a commit.
 
-        Much faster than the revset heads(ancestors(ctx) - draft())"""
+        Much faster than the revset ancestors(ctx) & draft()"""
         seen = set([nullrev])
         visit = util.deque()
         visit.append(ctx)
         while visit:
             ctx = visit.popleft()
+            yield ctx.node()
             for parent in ctx.parents():
                 rev = parent.rev()
                 if rev not in seen:
                     seen.add(rev)
                     if parent.mutable():
                         visit.append(parent)
-                    else:
-                        yield parent.node()
 
     wctx = repo[None]
     parents = wctx.parents()