changeset 22328:fba8c1a4ce21

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.
author Pierre-Yves David <pierre-yves.david@fb.com>
date Mon, 25 Aug 2014 14:58:11 +0200
parents f737631a9f0a
children ed37aa74d208
files mercurial/obsolete.py
diffstat 1 files changed, 3 insertions(+), 0 deletions(-) [+]
line wrap: on
line diff
--- 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: