Mercurial > public > mercurial-scm > hg
diff mercurial/branchmap.py @ 47062:f38bf44e077f stable
black: make codebase compatible with black v21.4b2 and v20.8b1
I don't know what exact version of black made it care about these whitespace
differences, but this is the version I got when I just installed it with
`pip3 install black`.
I'm intentionally not increasing the version of black required, as I don't want
to force everyone to upgrade their version of black, and these fixes are
backwards compatible with black v20.8b1. If there are more issues in the future
and this becomes a maintenance burden I may do so in a future change.
Tested with both versions of black (I got the older version via
`pip3 install black==20.8b1`)
Differential Revision: https://phab.mercurial-scm.org/D10539
author | Kyle Lippincott <spectral@google.com> |
---|---|
date | Fri, 30 Apr 2021 16:13:02 -0700 |
parents | d4ba4d51f85f |
children | bea4717415c0 |
line wrap: on
line diff
--- a/mercurial/branchmap.py Tue May 04 13:28:42 2021 -0400 +++ b/mercurial/branchmap.py Fri Apr 30 16:13:02 2021 -0700 @@ -220,7 +220,7 @@ self._hasnode = lambda x: True def _verifyclosed(self): - """ verify the closed nodes we have """ + """verify the closed nodes we have""" if self._closedverified: return for node in self._closednodes: @@ -230,7 +230,7 @@ self._closedverified = True def _verifybranch(self, branch): - """ verify head nodes for the given branch. """ + """verify head nodes for the given branch.""" if branch not in self._entries or branch in self._verifiedbranches: return for n in self._entries[branch]: @@ -240,7 +240,7 @@ self._verifiedbranches.add(branch) def _verifyall(self): - """ verifies nodes of all the branches """ + """verifies nodes of all the branches""" needverification = set(self._entries.keys()) - self._verifiedbranches for b in needverification: self._verifybranch(b) @@ -267,7 +267,7 @@ items = iteritems def hasbranch(self, label): - """ checks whether a branch of this name exists or not """ + """checks whether a branch of this name exists or not""" self._verifybranch(label) return label in self._entries @@ -385,7 +385,7 @@ yield (bn, heads) + self._branchtip(heads) def iterheads(self): - """ returns all the heads """ + """returns all the heads""" self._verifyall() return pycompat.itervalues(self._entries) @@ -784,7 +784,7 @@ wlock.release() def _writenames(self, repo): - """ write the new branch names to revbranchcache """ + """write the new branch names to revbranchcache""" if self._rbcnamescount != 0: f = repo.cachevfs.open(_rbcnames, b'ab') if f.tell() == self._rbcsnameslen: @@ -809,7 +809,7 @@ self._rbcnamescount = len(self._names) def _writerevs(self, repo, start): - """ write the new revs to revbranchcache """ + """write the new revs to revbranchcache""" revs = min(len(repo.changelog), len(self._rbcrevs) // _rbcrecsize) with repo.cachevfs.open(_rbcrevs, b'ab') as f: if f.tell() != start: