Patchwork [1,of,2,STABLE] phases: fix `nullid` reference in newheads

login
register
mail settings
Submitter Boris Feld
Date Aug. 21, 2018, 11:35 a.m.
Message ID <9c019032b49e561cefe8.1534851326@FB-lair>
Download mbox | patch
Permalink /patch/33931/
State Accepted
Headers show

Comments

Boris Feld - Aug. 21, 2018, 11:35 a.m.
# HG changeset patch
# User Boris Feld <boris.feld@octobus.net>
# Date 1534580656 -7200
#      Sat Aug 18 10:24:16 2018 +0200
# Branch stable
# Node ID 9c019032b49e561cefe8350cdcb51f6ab633caac
# Parent  cee9043c7dba154af10cf2817190f8c1ed62de62
# EXP-Topic perf-phases
# Available At https://bitbucket.org/octobus/mercurial-devel/
#              hg pull https://bitbucket.org/octobus/mercurial-devel/ -r 9c019032b49e
phases: fix `nullid` reference in newheads

Spotted by Yuya Nishihara.
Yuya Nishihara - Aug. 21, 2018, 12:01 p.m.
On Tue, 21 Aug 2018 13:35:26 +0200, Boris Feld wrote:
> # HG changeset patch
> # User Boris Feld <boris.feld@octobus.net>
> # Date 1534580656 -7200
> #      Sat Aug 18 10:24:16 2018 +0200
> # Branch stable
> # Node ID 9c019032b49e561cefe8350cdcb51f6ab633caac
> # Parent  cee9043c7dba154af10cf2817190f8c1ed62de62
> # EXP-Topic perf-phases
> # Available At https://bitbucket.org/octobus/mercurial-devel/
> #              hg pull https://bitbucket.org/octobus/mercurial-devel/ -r 9c019032b49e
> phases: fix `nullid` reference in newheads

Queued, thanks.

Patch

diff --git a/mercurial/phases.py b/mercurial/phases.py
--- a/mercurial/phases.py
+++ b/mercurial/phases.py
@@ -673,7 +673,7 @@  def newheads(repo, heads, roots):
     rev = cl.nodemap.get
     if not roots:
         return heads
-    if not heads or heads == [nullrev]:
+    if not heads or heads == [nullid]:
         return []
     # The logic operated on revisions, convert arguments early for convenience
     new_heads = set(rev(n) for n in heads if n != nullid)