Patchwork [3,of,6] revset: remove nullrev from set computed in parents()

login
register
mail settings
Submitter Pierre-Yves David
Date Sept. 18, 2014, 9:40 p.m.
Message ID <9275e924b18bd15e4d4e.1411076456@marginatus.alto.octopoid.net>
Download mbox | patch
Permalink /patch/5874/
State Accepted
Headers show

Comments

Pierre-Yves David - Sept. 18, 2014, 9:40 p.m.
# HG changeset patch
# User Pierre-Yves David <pierre-yves.david@fb.com>
# Date 1411008566 25200
#      Wed Sep 17 19:49:26 2014 -0700
# Node ID 9275e924b18bd15e4d4e3e6183c9bc87f5f60992
# Parent  fd7037c893a0471fee398c230b4b7a247ae5a561
revset: remove nullrev from set computed in parents()

The old code relied on the subset content to get rid of invalid value. We would
like to be able to rely more on the computation in parents() so we filter out
the invalid value

Patch

diff --git a/mercurial/revset.py b/mercurial/revset.py
--- a/mercurial/revset.py
+++ b/mercurial/revset.py
@@ -1235,10 +1235,11 @@  def parents(repo, subset, x):
     else:
         ps = set()
         cl = repo.changelog
         for r in getset(repo, spanset(repo), x):
             ps.update(cl.parentrevs(r))
+    ps -= set([node.nullrev])
     return baseset(ps) & subset
 
 def parentspec(repo, subset, x, n):
     """``set^0``
     The set.