[PATCH] localrepo: cleanup var names and comments

Joshua Redstone joshua.redstone at fb.com
Fri May 11 14:53:06 CDT 2012


# HG changeset patch
# User redstone
# Date 1336758792 25200
# Node ID 4626f155f919c6ca019e807f33367e075a60b96e
# Parent  ddd4996740c785cc187766249977ea3ece8c17ab
localrepo:  cleanup var names and comments

Cosmetic cleanup.  Fix comment typo referring to the notion of multiple tips.
Make variable describing a generator end in 'gen'.
Fix another var containing a node not to end with 'rev'.

diff -r ddd4996740c7 -r 4626f155f919 mercurial/localrepo.py
--- a/mercurial/localrepo.py	Tue May 08 12:05:45 2012 -0500
+++ b/mercurial/localrepo.py	Fri May 11 10:53:12 2012 -0700
@@ -505,7 +505,7 @@
             partial = self._branchcache
 
         self._branchtags(partial, lrev)
-        # this private cache holds all heads (not just tips)
+        # this private cache holds all heads (not just the tip)
         self._branchcache = partial
 
     def branchmap(self):
@@ -585,8 +585,8 @@
                 latest = newnodes.pop()
                 if latest not in bheads:
                     continue
-                minbhrev = self[bheads[0]].node()
-                reachable = self.changelog.reachable(latest, minbhrev)
+                minbhnode = self[bheads[0]].node()
+                reachable = self.changelog.reachable(latest, minbhnode)
                 reachable.remove(latest)
                 if reachable:
                     bheads = [b for b in bheads if b not in reachable]
@@ -1694,7 +1694,7 @@
                     # * missingheads part of comon (::commonheads)
                     common = set(outgoing.common)
                     cheads = [node for node in revs if node in common]
-                    # and 
+                    # and
                     # * commonheads parents on missing
                     revset = self.set('%ln and parents(roots(%ln))',
                                      outgoing.commonheads,
diff -r ddd4996740c7 -r 4626f155f919 mercurial/repair.py
--- a/mercurial/repair.py	Tue May 08 12:05:45 2012 -0500
+++ b/mercurial/repair.py	Fri May 11 10:53:12 2012 -0700
@@ -38,14 +38,14 @@
     """return the changesets which will be broken by the truncation"""
     s = set()
     def collectone(revlog):
-        links = (revlog.linkrev(i) for i in revlog)
+        linkgen = (revlog.linkrev(i) for i in revlog)
         # find the truncation point of the revlog
-        for lrev in links:
+        for lrev in linkgen:
             if lrev >= striprev:
                 break
         # see if any revision after this point has a linkrev
         # less than striprev (those will be broken by strip)
-        for lrev in links:
+        for lrev in linkgen:
             if lrev < striprev:
                 s.add(lrev)
 


More information about the Mercurial-devel mailing list