changeset 47426:e7ad2490d623

transaction: clarify a conditionnal about version check Let us move the short branch early. Differential Revision: https://phab.mercurial-scm.org/D10844
author Pierre-Yves David <pierre-yves.david@octobus.net>
date Wed, 09 Jun 2021 01:13:09 +0200
parents 0e4e9c1b4cc8
children d2e0226b511a
files mercurial/transaction.py
diffstat 1 files changed, 3 insertions(+), 3 deletions(-) [+]
line wrap: on
line diff
--- a/mercurial/transaction.py	Wed Jun 09 01:14:18 2021 +0200
+++ b/mercurial/transaction.py	Wed Jun 09 01:13:09 2021 +0200
@@ -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,