shelve: rename 'publicancestors' to something accurate (issue4737)
authorPierre-Yves David <pierre-yves.david@fb.com>
Fri, 09 Oct 2015 15:31:50 -0700
changeset 26602 c062a9c0293c
parent 26601 c5c7c686d6a6
child 26603 517ffec37dee
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).
hgext/shelve.py
--- a/hgext/shelve.py	Fri Oct 09 12:30:46 2015 -0500
+++ b/hgext/shelve.py	Fri Oct 09 15:31:50 2015 -0700
@@ -219,8 +219,8 @@
 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])
@@ -326,7 +326,7 @@
                 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'),