Patchwork D10844: transaction: clarify a conditionnal about version check

login
register
mail settings
Submitter phabricator
Date June 9, 2021, 2:37 p.m.
Message ID <differential-rev-PHID-DREV-mguecbotxsy4eanbd7gf-req@mercurial-scm.org>
Download mbox | patch
Permalink /patch/49164/
State Superseded
Headers show

Comments

phabricator - June 9, 2021, 2:37 p.m.
marmoute created this revision.
Herald added a reviewer: hg-reviewers.
Herald added a subscriber: mercurial-patches.

REVISION SUMMARY
  Let us move the short branch early.

REPOSITORY
  rHG Mercurial

BRANCH
  default

REVISION DETAIL
  https://phab.mercurial-scm.org/D10844

AFFECTED FILES
  mercurial/transaction.py

CHANGE DETAILS




To: marmoute, #hg-reviewers
Cc: mercurial-patches, mercurial-devel

Patch

diff --git a/mercurial/transaction.py b/mercurial/transaction.py
--- a/mercurial/transaction.py
+++ b/mercurial/transaction.py
@@ -743,15 +743,15 @@ 
         lines = fp.readlines()
         if lines:
             ver = lines[0][:-1]
-            if ver == (b'%d' % version):
+            if ver != (b'%d' % version):
+                report(BAD_VERSION_MSG)
+            else:
                 for line in lines[1:]:
                     if line:
                         # Shave off the trailing newline
                         line = line[:-1]
                         l, f, b, c = line.split(b'\0')
                         backupentries.append((l, f, b, bool(c)))
-            else:
-                report(BAD_VERSION_MSG)
 
     _playback(
         file,