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

Pierre-Yves David pierre-yves.david at ens-lyon.org
Tue Sep 16 21:28:33 CDT 2014


# HG changeset patch
# User Pierre-Yves David <pierre-yves.david at 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

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]


More information about the Mercurial-devel mailing list