changeset 22333:5bf18f8ca89d

obsstore: store and preserve ondisk version
author Pierre-Yves David <pierre-yves.david@fb.com>
date Mon, 25 Aug 2014 16:18:44 +0200
parents 13e22358e9d2
children f2c3cfc30e9c
files mercurial/obsolete.py
diffstat 1 files changed, 3 insertions(+), 2 deletions(-) [+]
line wrap: on
line diff
--- a/mercurial/obsolete.py	Mon Aug 25 16:51:51 2014 +0200
+++ b/mercurial/obsolete.py	Mon Aug 25 16:18:44 2014 +0200
@@ -311,8 +311,9 @@
         self.children = {}
         self.sopener = sopener
         data = sopener.tryread('obsstore')
+        self._version = _fm0version
         if data:
-            version, markers = _readmarkers(data)
+            self._version, markers = _readmarkers(data)
             self._load(markers)
 
     def __iter__(self):
@@ -382,7 +383,7 @@
                 offset = f.tell()
                 transaction.add('obsstore', offset)
                 # offset == 0: new file - add the version header
-                for bytes in _encodemarkers(new, offset == 0):
+                for bytes in _encodemarkers(new, offset == 0, self._version):
                     f.write(bytes)
             finally:
                 # XXX: f.close() == filecache invalidation == obsstore rebuilt.