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

login
register
mail settings
Submitter Pierre-Yves David
Date May 4, 2015, 10:25 p.m.
Message ID <8aff772b686be3240fc0.1430778353@marginatus.alto.octopoid.net>
Download mbox | patch
Permalink /patch/8880/
State Accepted
Headers show

Comments

Pierre-Yves David - May 4, 2015, 10:25 p.m.
# HG changeset patch
# User Pierre-Yves David <pierre-yves.david@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.

Patch

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)