This is shorter and easier to read as the indentation remains the same.
We extract the long message in a module level constant for clarity.
hg-reviewers |
This is shorter and easier to read as the indentation remains the same.
We extract the long message in a module level constant for clarity.
Automatic diff as part of commit; lint not applicable. |
Automatic diff as part of commit; unit tests not applicable. |
Path | Packages | |||
---|---|---|---|---|
M | mercurial/verify.py (14 lines) |
Status | Author | Revision | |
---|---|---|---|
Closed | marmoute | ||
Closed | marmoute | ||
Closed | marmoute | ||
Closed | marmoute | ||
Closed | marmoute | ||
Closed | marmoute | ||
Closed | marmoute | ||
Closed | marmoute | ||
Closed | marmoute | ||
Closed | marmoute | ||
Closed | marmoute | ||
Closed | marmoute | ||
Closed | marmoute | ||
Closed | marmoute | ||
Closed | marmoute | ||
Closed | marmoute | ||
Closed | marmoute | ||
Closed | marmoute | D10805 verify: align a comment line |
f = f.replace(b'//', b'/') | f = f.replace(b'//', b'/') | ||||
return f | return f | ||||
HINT_FNCACHE = _( | HINT_FNCACHE = _( | ||||
b'hint: run "hg debugrebuildfncache" to recover from corrupt fncache\n' | b'hint: run "hg debugrebuildfncache" to recover from corrupt fncache\n' | ||||
) | ) | ||||
WARN_PARENT_DIR_UNKNOWN_REV = _( | |||||
b"parent-directory manifest refers to unknown revision %s" | |||||
) | |||||
class verifier(object): | class verifier(object): | ||||
def __init__(self, repo, level=None): | def __init__(self, repo, level=None): | ||||
self.repo = repo.unfiltered() | self.repo = repo.unfiltered() | ||||
self.ui = repo.ui | self.ui = repo.ui | ||||
self.match = repo.narrowmatch() | self.match = repo.narrowmatch() | ||||
if level is None: | if level is None: | ||||
level = VERIFY_DEFAULT | level = VERIFY_DEFAULT | ||||
progress.complete() | progress.complete() | ||||
if self.havemf: | if self.havemf: | ||||
# since we delete entry in `mflinkrevs` during iteration, any | # since we delete entry in `mflinkrevs` during iteration, any | ||||
# remaining entries are "missing". We need to issue errors for them. | # remaining entries are "missing". We need to issue errors for them. | ||||
changesetpairs = [(c, m) for m in mflinkrevs for c in mflinkrevs[m]] | changesetpairs = [(c, m) for m in mflinkrevs for c in mflinkrevs[m]] | ||||
for c, m in sorted(changesetpairs): | for c, m in sorted(changesetpairs): | ||||
if dir: | if dir: | ||||
self._err( | self._err(c, WARN_PARENT_DIR_UNKNOWN_REV % short(m), label) | ||||
c, | |||||
_( | |||||
b"parent-directory manifest refers to unknown" | |||||
b" revision %s" | |||||
) | |||||
% short(m), | |||||
label, | |||||
) | |||||
else: | else: | ||||
self._err( | self._err( | ||||
c, | c, | ||||
_(b"changeset refers to unknown revision %s") | _(b"changeset refers to unknown revision %s") | ||||
% short(m), | % short(m), | ||||
label, | label, | ||||
) | ) | ||||