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

Pierre-Yves David pierre-yves.david at ens-lyon.org
Thu Sep 18 16:40:56 CDT 2014


# HG changeset patch
# User Pierre-Yves David <pierre-yves.david at 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

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.


More information about the Mercurial-devel mailing list