Mercurial > public > mercurial-scm > hg-stable
comparison mercurial/bundle2.py @ 43117:8ff1ecfadcd1
cleanup: join string literals that are already on one line
Thanks to Kyle for noticing this and for providing the regular
expression to run on the codebase.
This patch has been reviewed by the test suite and they approved of
it.
# skip-blame: fallout from mass reformatting
Differential Revision: https://phab.mercurial-scm.org/D7028
author | Martin von Zweigbergk <martinvonz@google.com> |
---|---|
date | Tue, 08 Oct 2019 15:06:18 -0700 |
parents | 4aa72cdf616f |
children | c17a63eb5d4c |
comparison
equal
deleted
inserted
replaced
43116:defabf63e969 | 43117:8ff1ecfadcd1 |
---|---|
1231 return None | 1231 return None |
1232 | 1232 |
1233 def __call__(self): | 1233 def __call__(self): |
1234 | 1234 |
1235 self.ui.debug( | 1235 self.ui.debug( |
1236 b'bundle2-input-stream-interrupt:' b' opening out of band context\n' | 1236 b'bundle2-input-stream-interrupt: opening out of band context\n' |
1237 ) | 1237 ) |
1238 indebug(self.ui, b'bundle2 stream interruption, looking for a part.') | 1238 indebug(self.ui, b'bundle2 stream interruption, looking for a part.') |
1239 headerblock = self._readpartheader() | 1239 headerblock = self._readpartheader() |
1240 if headerblock is None: | 1240 if headerblock is None: |
1241 indebug(self.ui, b'no part found during interruption.') | 1241 indebug(self.ui, b'no part found during interruption.') |
1250 raise | 1250 raise |
1251 finally: | 1251 finally: |
1252 if not hardabort: | 1252 if not hardabort: |
1253 part.consume() | 1253 part.consume() |
1254 self.ui.debug( | 1254 self.ui.debug( |
1255 b'bundle2-input-stream-interrupt:' b' closing out of band context\n' | 1255 b'bundle2-input-stream-interrupt: closing out of band context\n' |
1256 ) | 1256 ) |
1257 | 1257 |
1258 | 1258 |
1259 class interruptoperation(object): | 1259 class interruptoperation(object): |
1260 """A limited operation to be use by part handler during interruption | 1260 """A limited operation to be use by part handler during interruption |
1318 ) | 1318 ) |
1319 | 1319 |
1320 s = read(headersize) | 1320 s = read(headersize) |
1321 if len(s) < headersize: | 1321 if len(s) < headersize: |
1322 raise error.Abort( | 1322 raise error.Abort( |
1323 _(b'stream ended unexpectedly ' b' (got %d bytes, expected %d)') | 1323 _(b'stream ended unexpectedly (got %d bytes, expected %d)') |
1324 % (len(s), chunksize) | 1324 % (len(s), chunksize) |
1325 ) | 1325 ) |
1326 | 1326 |
1327 chunksize = unpack(s)[0] | 1327 chunksize = unpack(s)[0] |
1328 | 1328 |
1887 else: | 1887 else: |
1888 # compression argument is only for the bundle2 case | 1888 # compression argument is only for the bundle2 case |
1889 assert compression is None | 1889 assert compression is None |
1890 if cg.version != b'01': | 1890 if cg.version != b'01': |
1891 raise error.Abort( | 1891 raise error.Abort( |
1892 _(b'old bundle types only supports v1 ' b'changegroups') | 1892 _(b'old bundle types only supports v1 changegroups') |
1893 ) | 1893 ) |
1894 header, comp = bundletypes[bundletype] | 1894 header, comp = bundletypes[bundletype] |
1895 if comp not in util.compengines.supportedbundletypes: | 1895 if comp not in util.compengines.supportedbundletypes: |
1896 raise error.Abort(_(b'unknown stream compression type: %s') % comp) | 1896 raise error.Abort(_(b'unknown stream compression type: %s') % comp) |
1897 compengine = util.compengines.forbundletype(comp) | 1897 compengine = util.compengines.forbundletype(comp) |
2134 # Trigger a transaction so that we are guaranteed to have the lock now. | 2134 # Trigger a transaction so that we are guaranteed to have the lock now. |
2135 if op.ui.configbool(b'experimental', b'bundle2lazylocking'): | 2135 if op.ui.configbool(b'experimental', b'bundle2lazylocking'): |
2136 op.gettransaction() | 2136 op.gettransaction() |
2137 if sorted(heads) != sorted(op.repo.heads()): | 2137 if sorted(heads) != sorted(op.repo.heads()): |
2138 raise error.PushRaced( | 2138 raise error.PushRaced( |
2139 b'remote repository changed while pushing - ' b'please try again' | 2139 b'remote repository changed while pushing - please try again' |
2140 ) | 2140 ) |
2141 | 2141 |
2142 | 2142 |
2143 @parthandler(b'check:updated-heads') | 2143 @parthandler(b'check:updated-heads') |
2144 def handlecheckupdatedheads(op, inpart): | 2144 def handlecheckupdatedheads(op, inpart): |