obsolete: extract the part of _readmarkers specific to format version 0
authorPierre-Yves David <pierre-yves.david@fb.com>
Mon, 25 Aug 2014 14:58:11 +0200
changeset 22328 fba8c1a4ce21
parent 22327 f737631a9f0a
child 22329 ed37aa74d208
obsolete: extract the part of _readmarkers specific to format version 0 If we are to introduce new formats we need to be able call different functions for different formats. Creating a function for format version 0 is the first step.
mercurial/obsolete.py
--- a/mercurial/obsolete.py	Mon Aug 25 14:56:15 2014 +0200
+++ b/mercurial/obsolete.py	Mon Aug 25 14:58:11 2014 +0200
@@ -145,7 +145,10 @@
     if diskversion != _fm0version:
         raise util.Abort(_('parsing obsolete marker: unknown version %r')
                          % diskversion)
+    return _fm0readmarkers(data, off)
 
+def _fm0readmarkers(data, off=0):
+    """Read and enumerate markers from raw data in format version 0"""
     # Loop on markers
     l = len(data)
     while off + _fm0fsize <= l: