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

login
register
mail settings
Submitter Pierre-Yves David
Date Sept. 30, 2014, 6:01 p.m.
Message ID <b844b3a93afe695d712f.1412100083@marginatus.alto.octopoid.net>
Download mbox | patch
Permalink /patch/6039/
State Accepted
Headers show

Comments

Pierre-Yves David - Sept. 30, 2014, 6:01 p.m.
# HG changeset patch
# User Pierre-Yves David <pierre-yves.david@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.

Patch

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):