[PATCH issue4737] shelve: rename 'publicancestors' to something accurate (issue4737)
Augie Fackler
raf at durin42.com
Mon Oct 12 12:09:49 CDT 2015
On Mon, Oct 12, 2015 at 09:06:59AM -0700, Pierre-Yves David wrote:
> # 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)
Queued, thanks.
>
> 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))
>
> _______________________________________________
> Mercurial-devel mailing list
> Mercurial-devel at selenic.com
> https://selenic.com/mailman/listinfo/mercurial-devel
More information about the Mercurial-devel
mailing list