[PATCH] localrepo: cleanup var names and comments
Matt Mackall
mpm at selenic.com
Fri May 11 15:34:21 CDT 2012
On Fri, 2012-05-11 at 12:53 -0700, Joshua Redstone wrote:
> # HG changeset patch
> # User redstone
> # Date 1336758792 25200
> # Node ID 4626f155f919c6ca019e807f33367e075a60b96e
> # Parent ddd4996740c785cc187766249977ea3ece8c17ab
> localrepo: cleanup var names and comments
Extra space. I'll clean this up and queue it, thanks.
> 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)
The original comment is actually correct here, as it's "heads of
branches, not just tips (highest-numbered revision) of branches".
So we should use the term "branch tips" instead.
> 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)
>
> _______________________________________________
> Mercurial-devel mailing list
> Mercurial-devel at selenic.com
> http://selenic.com/mailman/listinfo/mercurial-devel
--
Mathematics is the supreme nostalgia of our time.
More information about the Mercurial-devel
mailing list