Mercurial > public > mercurial-scm > hg-stable
diff mercurial/transaction.py @ 45957: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 | ec73a6a75985 |
children | 88de2639901b |
line wrap: on
line diff
--- a/mercurial/transaction.py Fri Nov 27 17:00:00 2020 -0500 +++ b/mercurial/transaction.py Fri Nov 27 17:03:29 2020 -0500 @@ -425,10 +425,10 @@ @active def replace(self, file, offset): - ''' + """ replace can only replace already committed entries that are not pending in the queue - ''' + """ if file in self._newfiles: if not offset: return @@ -476,9 +476,9 @@ @active def writepending(self): - '''write pending file to temporary version + """write pending file to temporary version - This is used to allow hooks to view a transaction before commit''' + This is used to allow hooks to view a transaction before commit""" categories = sorted(self._pendingcallback) for cat in categories: # remove callback since the data will have been flushed @@ -489,8 +489,7 @@ @active def hasfinalize(self, category): - """check is a callback already exist for a category - """ + """check is a callback already exist for a category""" return category in self._finalizecallback @active @@ -533,11 +532,11 @@ @active def addvalidator(self, category, callback): - """ adds a callback to be called when validating the transaction. + """adds a callback to be called when validating the transaction. The transaction will be given as the first argument to the callback. - callback should raise exception if to abort transaction """ + callback should raise exception if to abort transaction""" self._validatecallback[category] = callback @active @@ -624,9 +623,9 @@ @active def abort(self): - '''abort the transaction (generally called on error, or when the + """abort the transaction (generally called on error, or when the transaction is not explicitly committed before going out of - scope)''' + scope)""" self._abort() def _writeundo(self):