[Request] [+ ] D10843: transaction: extract message about different version in a constants
marmoute (Pierre-Yves David)
phabricator at mercurial-scm.org
Wed Jun 9 14:37:19 UTC 2021
marmoute created this revision.
Herald added a reviewer: hg-reviewers.
Herald added a subscriber: mercurial-patches.
REVISION SUMMARY
This make the code a bit simpler and clearer.
(This is an opportunity improvement while looking at something next to that.)
REPOSITORY
rHG Mercurial
BRANCH
default
REVISION DETAIL
https://phab.mercurial-scm.org/D10843
AFFECTED FILES
mercurial/transaction.py
CHANGE DETAILS
diff --git a/mercurial/transaction.py b/mercurial/transaction.py
--- a/mercurial/transaction.py
+++ b/mercurial/transaction.py
@@ -702,6 +702,11 @@
self._releasefn = None # Help prevent cycles.
+BAD_VERSION_MSG = _(
+ b"journal was created by a different version of Mercurial\n"
+)
+
+
def rollback(opener, vfsmap, file, report, checkambigfiles=None):
"""Rolls back the transaction contained in the given file
@@ -746,12 +751,7 @@
l, f, b, c = line.split(b'\0')
backupentries.append((l, f, b, bool(c)))
else:
- report(
- _(
- b"journal was created by a different version of "
- b"Mercurial\n"
- )
- )
+ report(BAD_VERSION_MSG)
_playback(
file,
To: marmoute, #hg-reviewers
Cc: mercurial-patches, mercurial-devel
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mercurial-scm.org/pipermail/mercurial-patches/attachments/20210609/0ac2e68a/attachment-0001.html>
More information about the Mercurial-patches
mailing list