From patchwork Mon Feb 10 00:01:11 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Subject: [2,of,9] shelve: publicancestors do not have to visit nullrev From: Mads Kiilerich X-Patchwork-Id: 3525 Message-Id: <0449c9dbf366ade29b63.1391990471@localhost.localdomain> To: mercurial-devel@selenic.com Date: Mon, 10 Feb 2014 01:01:11 +0100 # HG changeset patch # User Mads Kiilerich # Date 1391989966 -3600 # Mon Feb 10 00:52:46 2014 +0100 # Node ID 0449c9dbf366ade29b6384f4d6e644095cd73bc5 # Parent 23335d0a2a4b55ae94c96819d12adfb67b22c609 shelve: publicancestors do not have to visit nullrev Not visiting nullrev seems more correct and might be a minor optimization. diff --git a/hgext/shelve.py b/hgext/shelve.py --- a/hgext/shelve.py +++ b/hgext/shelve.py @@ -22,7 +22,7 @@ shelve". """ from mercurial.i18n import _ -from mercurial.node import nullid, bin, hex +from mercurial.node import nullid, nullrev, bin, hex from mercurial import changegroup, cmdutil, scmutil, phases from mercurial import error, hg, mdiff, merge, patch, repair, util from mercurial import templatefilters @@ -125,7 +125,7 @@ def createcmd(ui, repo, pats, opts): """Compute the heads of the public ancestors of a commit. Much faster than the revset heads(ancestors(ctx) - draft())""" - seen = set() + seen = set([nullrev]) visit = util.deque() visit.append(ctx) while visit: