Mercurial > hg
comparison mercurial/revlog.py @ 45942:89a2afe31e82
formating: upgrade to black 20.8b1
This required a couple of small tweaks to un-confuse black, but now it
works. Big formatting changes come from:
* Dramatically improved collection-splitting logic upstream
* Black having a strong (correct IMO) opinion that """ is better than '''
Differential Revision: https://phab.mercurial-scm.org/D9430
author | Augie Fackler <raf@durin42.com> |
---|---|
date | Fri, 27 Nov 2020 17:03:29 -0500 |
parents | a6f08085edfe |
children | fc2d5c0aed7f |
comparison
equal
deleted
inserted
replaced
45941:346af7687c6f | 45942:89a2afe31e82 |
---|---|
1489 except TypeError: | 1489 except TypeError: |
1490 pass | 1490 pass |
1491 | 1491 |
1492 def lookup(self, id): | 1492 def lookup(self, id): |
1493 """locate a node based on: | 1493 """locate a node based on: |
1494 - revision number or str(revision number) | 1494 - revision number or str(revision number) |
1495 - nodeid or subset of hex nodeid | 1495 - nodeid or subset of hex nodeid |
1496 """ | 1496 """ |
1497 n = self._match(id) | 1497 n = self._match(id) |
1498 if n is not None: | 1498 if n is not None: |
1499 return n | 1499 return n |
1500 n = self._partialmatch(id) | 1500 n = self._partialmatch(id) |
1769 return base | 1769 return base |
1770 else: | 1770 else: |
1771 return rev - 1 | 1771 return rev - 1 |
1772 | 1772 |
1773 def issnapshot(self, rev): | 1773 def issnapshot(self, rev): |
1774 """tells whether rev is a snapshot | 1774 """tells whether rev is a snapshot""" |
1775 """ | |
1776 if not self._sparserevlog: | 1775 if not self._sparserevlog: |
1777 return self.deltaparent(rev) == nullrev | 1776 return self.deltaparent(rev) == nullrev |
1778 elif util.safehasattr(self.index, b'issnapshot'): | 1777 elif util.safehasattr(self.index, b'issnapshot'): |
1779 # directly assign the method to cache the testing and access | 1778 # directly assign the method to cache the testing and access |
1780 self.issnapshot = self.index.issnapshot | 1779 self.issnapshot = self.index.issnapshot |
2035 tr.replace(self.indexfile, trindex * self._io.size) | 2034 tr.replace(self.indexfile, trindex * self._io.size) |
2036 nodemaputil.setup_persistent_nodemap(tr, self) | 2035 nodemaputil.setup_persistent_nodemap(tr, self) |
2037 self._chunkclear() | 2036 self._chunkclear() |
2038 | 2037 |
2039 def _nodeduplicatecallback(self, transaction, node): | 2038 def _nodeduplicatecallback(self, transaction, node): |
2040 """called when trying to add a node already stored. | 2039 """called when trying to add a node already stored.""" |
2041 """ | |
2042 | 2040 |
2043 def addrevision( | 2041 def addrevision( |
2044 self, | 2042 self, |
2045 text, | 2043 text, |
2046 transaction, | 2044 transaction, |