[PATCH 2 of 4] revset-ancestors: rename 'revsnode' in 'inputrev'

Pierre-Yves David pierre-yves.david at ens-lyon.org
Mon May 4 17:25:53 CDT 2015


# HG changeset patch
# User Pierre-Yves David <pierre-yves.david at fb.com>
# Date 1395875670 25200
#      Wed Mar 26 16:14:30 2014 -0700
# Node ID 8aff772b686be3240fc04dc633dff18299ba7151
# Parent  78d36b8dfc8e5565b2544a27a828953435435d6f
revset-ancestors: rename 'revsnode' in 'inputrev'

We usually use 'node' for variable containing 20 bytes hash. There is nothing
nodish in this variable, so we rename it to "inputrev" as it old the next entry
of the iteration.

diff --git a/mercurial/revset.py b/mercurial/revset.py
--- a/mercurial/revset.py
+++ b/mercurial/revset.py
@@ -23,27 +23,27 @@ def _revancestors(repo, revs, followfirs
     else:
         cut = None
     cl = repo.changelog
 
     def iterate():
-        revqueue, revsnode = None, None
+        revqueue, inputrev = None, None
         h = []
 
         revs.sort(reverse=True)
         revqueue = util.deque(revs)
         if revqueue:
-            revsnode = revqueue.popleft()
-            heapq.heappush(h, -revsnode)
+            inputrev = revqueue.popleft()
+            heapq.heappush(h, -inputrev)
 
         seen = set()
         while h:
             current = -heapq.heappop(h)
             if current not in seen:
-                if revsnode and current == revsnode:
+                if inputrev and current == inputrev:
                     if revqueue:
-                        revsnode = revqueue.popleft()
-                        heapq.heappush(h, -revsnode)
+                        inputrev = revqueue.popleft()
+                        heapq.heappush(h, -inputrev)
                 seen.add(current)
                 yield current
                 for parent in cl.parentrevs(current)[:cut]:
                     if parent != node.nullrev:
                         heapq.heappush(h, -parent)


More information about the Mercurial-devel mailing list