Patchwork [3,of,4] obsolete: use version constants in the format mapping

login
register
mail settings
Submitter Pierre-Yves David
Date Sept. 17, 2014, 2:28 a.m.
Message ID <78d7d968abda48db22b9.1410920913@marginatus.alto.octopoid.net>
Download mbox | patch
Permalink /patch/5839/
State Superseded
Headers show

Comments

Pierre-Yves David - Sept. 17, 2014, 2:28 a.m.
# HG changeset patch
# User Pierre-Yves David <pierre-yves.david@fb.com>
# Date 1410908271 25200
#      Tue Sep 16 15:57:51 2014 -0700
# Node ID 78d7d968abda48db22b94f59e6b3ddc926aa9ef8
# Parent  774185befa92282889671bdd470844ffa7d6efa7
obsolete: use version constants in the format mapping

Patch

diff --git a/mercurial/obsolete.py b/mercurial/obsolete.py
--- a/mercurial/obsolete.py
+++ b/mercurial/obsolete.py
@@ -208,11 +208,11 @@  def _fm0encodeonemarker(marker):
     data.extend(sucs)
     return _pack(format, *data) + metadata
 
 # mapping to read/write various marker formats
 # <version> -> (decoder, encoder)
-formats = {0: (_fm0readmarkers, _fm0encodeonemarker)}
+formats = {_fm0version: (_fm0readmarkers, _fm0encodeonemarker)}
 
 def _readmarkers(data):
     """Read and enumerate markers from raw data"""
     off = 0
     diskversion = _unpack('>B', data[off:off + 1])[0]