[PATCH 2 of 4 V2] obsolete: use the `version` argument in encodemarkers

Pierre-Yves David pierre-yves.david at ens-lyon.org
Tue Sep 30 13:01:23 CDT 2014


# HG changeset patch
# User Pierre-Yves David <pierre-yves.david at fb.com>
# Date 1410908198 25200
#      Tue Sep 16 15:56:38 2014 -0700
# Node ID b844b3a93afe695d712fd002764b8507821c46fe
# Parent  10778745265788c0a40cb9feef97bfb952bd5031
obsolete: use the `version` argument in encodemarkers

Recent scientific studies show that assigning a variable have no effect on
unrelated constant. We therefore use the variable where we intended to in the
first place.

diff --git a/mercurial/obsolete.py b/mercurial/obsolete.py
--- a/mercurial/obsolete.py
+++ b/mercurial/obsolete.py
@@ -225,11 +225,11 @@ def _readmarkers(data):
 def encodemarkers(markers, addheader=False, version=_fm0version):
     # Kept separate from flushmarkers(), it will be reused for
     # markers exchange.
     encodeone = formats[version][1]
     if addheader:
-        yield _pack('>B', _fm0version)
+        yield _pack('>B', version)
     for marker in markers:
         yield encodeone(marker)
 
 
 def encodemeta(meta):


More information about the Mercurial-devel mailing list