Mercurial > public > mercurial-scm > hg
comparison mercurial/revlog.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 | d783f945a701 |
children | 3de4d13f22be |
comparison
equal
deleted
inserted
replaced
43116:defabf63e969 | 43117:8ff1ecfadcd1 |
---|---|
242 return revlogoldindex(index), nodemap, None | 242 return revlogoldindex(index), nodemap, None |
243 | 243 |
244 def packentry(self, entry, node, version, rev): | 244 def packentry(self, entry, node, version, rev): |
245 if gettype(entry[0]): | 245 if gettype(entry[0]): |
246 raise error.RevlogError( | 246 raise error.RevlogError( |
247 _(b'index entry flags need revlog ' b'version 1') | 247 _(b'index entry flags need revlog version 1') |
248 ) | 248 ) |
249 e2 = ( | 249 e2 = ( |
250 getoffset(entry[0]), | 250 getoffset(entry[0]), |
251 entry[1], | 251 entry[1], |
252 entry[3], | 252 entry[3], |
449 ): | 449 ): |
450 flagutil.insertflagprocessor(flag, processor, self._flagprocessors) | 450 flagutil.insertflagprocessor(flag, processor, self._flagprocessors) |
451 | 451 |
452 if self._chunkcachesize <= 0: | 452 if self._chunkcachesize <= 0: |
453 raise error.RevlogError( | 453 raise error.RevlogError( |
454 _(b'revlog chunk cache size %r is not ' b'greater than 0') | 454 _(b'revlog chunk cache size %r is not greater than 0') |
455 % self._chunkcachesize | 455 % self._chunkcachesize |
456 ) | 456 ) |
457 elif self._chunkcachesize & (self._chunkcachesize - 1): | 457 elif self._chunkcachesize & (self._chunkcachesize - 1): |
458 raise error.RevlogError( | 458 raise error.RevlogError( |
459 _(b'revlog chunk cache size %r is not a ' b'power of 2') | 459 _(b'revlog chunk cache size %r is not a power of 2') |
460 % self._chunkcachesize | 460 % self._chunkcachesize |
461 ) | 461 ) |
462 | 462 |
463 indexdata = b'' | 463 indexdata = b'' |
464 self._initempty = True | 464 self._initempty = True |
490 fmt = versionflags & 0xFFFF | 490 fmt = versionflags & 0xFFFF |
491 | 491 |
492 if fmt == REVLOGV0: | 492 if fmt == REVLOGV0: |
493 if flags: | 493 if flags: |
494 raise error.RevlogError( | 494 raise error.RevlogError( |
495 _(b'unknown flags (%#04x) in version %d ' b'revlog %s') | 495 _(b'unknown flags (%#04x) in version %d revlog %s') |
496 % (flags >> 16, fmt, self.indexfile) | 496 % (flags >> 16, fmt, self.indexfile) |
497 ) | 497 ) |
498 | 498 |
499 self._inline = False | 499 self._inline = False |
500 self._generaldelta = False | 500 self._generaldelta = False |
501 | 501 |
502 elif fmt == REVLOGV1: | 502 elif fmt == REVLOGV1: |
503 if flags & ~REVLOGV1_FLAGS: | 503 if flags & ~REVLOGV1_FLAGS: |
504 raise error.RevlogError( | 504 raise error.RevlogError( |
505 _(b'unknown flags (%#04x) in version %d ' b'revlog %s') | 505 _(b'unknown flags (%#04x) in version %d revlog %s') |
506 % (flags >> 16, fmt, self.indexfile) | 506 % (flags >> 16, fmt, self.indexfile) |
507 ) | 507 ) |
508 | 508 |
509 self._inline = versionflags & FLAG_INLINE_DATA | 509 self._inline = versionflags & FLAG_INLINE_DATA |
510 self._generaldelta = versionflags & FLAG_GENERALDELTA | 510 self._generaldelta = versionflags & FLAG_GENERALDELTA |
511 | 511 |
512 elif fmt == REVLOGV2: | 512 elif fmt == REVLOGV2: |
513 if flags & ~REVLOGV2_FLAGS: | 513 if flags & ~REVLOGV2_FLAGS: |
514 raise error.RevlogError( | 514 raise error.RevlogError( |
515 _(b'unknown flags (%#04x) in version %d ' b'revlog %s') | 515 _(b'unknown flags (%#04x) in version %d revlog %s') |
516 % (flags >> 16, fmt, self.indexfile) | 516 % (flags >> 16, fmt, self.indexfile) |
517 ) | 517 ) |
518 | 518 |
519 self._inline = versionflags & FLAG_INLINE_DATA | 519 self._inline = versionflags & FLAG_INLINE_DATA |
520 # generaldelta implied by version 2 revlogs. | 520 # generaldelta implied by version 2 revlogs. |
2705 censorrev = self.rev(censornode) | 2705 censorrev = self.rev(censornode) |
2706 tombstone = storageutil.packmeta({b'censored': tombstone}, b'') | 2706 tombstone = storageutil.packmeta({b'censored': tombstone}, b'') |
2707 | 2707 |
2708 if len(tombstone) > self.rawsize(censorrev): | 2708 if len(tombstone) > self.rawsize(censorrev): |
2709 raise error.Abort( | 2709 raise error.Abort( |
2710 _(b'censor tombstone must be no longer than ' b'censored data') | 2710 _(b'censor tombstone must be no longer than censored data') |
2711 ) | 2711 ) |
2712 | 2712 |
2713 # Rewriting the revlog in place is hard. Our strategy for censoring is | 2713 # Rewriting the revlog in place is hard. Our strategy for censoring is |
2714 # to create a new revlog, copy all revisions to it, then replace the | 2714 # to create a new revlog, copy all revisions to it, then replace the |
2715 # revlogs on transaction close. | 2715 # revlogs on transaction close. |