Mercurial > hg
comparison mercurial/state.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 | d4a28b76fa54 |
children | f38bf44e077f |
comparison
equal
deleted
inserted
replaced
45941:346af7687c6f | 45942:89a2afe31e82 |
---|---|
53 Uses cbor to serialize and deserialize data while writing and reading from | 53 Uses cbor to serialize and deserialize data while writing and reading from |
54 disk. | 54 disk. |
55 """ | 55 """ |
56 | 56 |
57 def __init__(self, repo, fname): | 57 def __init__(self, repo, fname): |
58 """ repo is the repo object | 58 """repo is the repo object |
59 fname is the file name in which data should be stored in .hg directory | 59 fname is the file name in which data should be stored in .hg directory |
60 """ | 60 """ |
61 self._repo = repo | 61 self._repo = repo |
62 self.fname = fname | 62 self.fname = fname |
63 | 63 |
103 return self._repo.vfs.exists(self.fname) | 103 return self._repo.vfs.exists(self.fname) |
104 | 104 |
105 | 105 |
106 class _statecheck(object): | 106 class _statecheck(object): |
107 """a utility class that deals with multistep operations like graft, | 107 """a utility class that deals with multistep operations like graft, |
108 histedit, bisect, update etc and check whether such commands | 108 histedit, bisect, update etc and check whether such commands |
109 are in an unfinished conditition or not and return appropriate message | 109 are in an unfinished conditition or not and return appropriate message |
110 and hint. | 110 and hint. |
111 It also has the ability to register and determine the states of any new | 111 It also has the ability to register and determine the states of any new |
112 multistep operation or multistep command extension. | 112 multistep operation or multistep command extension. |
113 """ | 113 """ |
114 | 114 |
115 def __init__( | 115 def __init__( |
116 self, | 116 self, |
117 opname, | 117 opname, |
171 ) | 171 ) |
172 else: | 172 else: |
173 return _( | 173 return _( |
174 b"use 'hg %s --continue', 'hg %s --abort', " | 174 b"use 'hg %s --continue', 'hg %s --abort', " |
175 b"or 'hg %s --stop'" | 175 b"or 'hg %s --stop'" |
176 ) % (self._opname, self._opname, self._opname,) | 176 ) % ( |
177 self._opname, | |
178 self._opname, | |
179 self._opname, | |
180 ) | |
177 | 181 |
178 return self._cmdhint | 182 return self._cmdhint |
179 | 183 |
180 def msg(self): | 184 def msg(self): |
181 """returns the status message corresponding to the command""" | 185 """returns the status message corresponding to the command""" |