[PATCH issue4737] shelve: rename 'publicancestors' to something accurate (issue4737)

Pierre-Yves David pierre-yves.david at ens-lyon.org
Mon Oct 12 16:06:59 UTC 2015


# HG changeset patch
# User Pierre-Yves David <pierre-yves.david at fb.com>
# Date 1444429910 25200
#      Fri Oct 09 15:31:50 2015 -0700
# Node ID 4b05da57ecc9e19900e59265a9a0383ce0ad9208
# Parent  9ca13d10881d7044b79d903ad64653f6541591f1
# EXP-Topic issue4737
shelve: rename 'publicancestors' to something accurate (issue4737)

That function is actually not returning public ancestors at all. This is
pointed by the second line of the docstring...

The bundling behavior was made correct in a5141977198d but with confusion
remaining regarding what each function was doing.

This close issue4737, because this highlight that shelve is actually -not-
bundling too much data (this was actually properly tested).

diff --git a/hgext/shelve.py b/hgext/shelve.py
--- a/hgext/shelve.py
+++ b/hgext/shelve.py
@@ -217,12 +217,12 @@ def _aborttransaction(repo):
             repo.vfs.unlink(dirstatebackup)
 
 def createcmd(ui, repo, pats, opts):
     """subcommand that creates a new shelve"""
 
-    def publicancestors(ctx):
-        """Compute the public ancestors of a commit.
+    def mutableancestors(ctx):
+        """return all mutable ancestors for ctx (included)
 
         Much faster than the revset ancestors(ctx) & draft()"""
         seen = set([nullrev])
         visit = collections.deque()
         visit.append(ctx)
@@ -324,11 +324,11 @@ def createcmd(ui, repo, pats, opts):
                             "'hg status')\n") % len(stat.deleted))
             else:
                 ui.status(_("nothing changed\n"))
             return 1
 
-        bases = list(publicancestors(repo[node]))
+        bases = list(mutableancestors(repo[node]))
         shelvedfile(repo, name, 'hg').writebundle(bases, node)
         cmdutil.export(repo, [node],
                        fp=shelvedfile(repo, name, 'patch').opener('wb'),
                        opts=mdiff.diffopts(git=True))
 


More information about the Mercurial-devel mailing list