debugobsconvert: also deduplicate markers in the process
authorPierre-Yves David <pierre-yves.david@fb.com>
Thu, 20 Nov 2014 15:33:14 -0800
changeset 1169 6f08a8f6bb1d
parent 1159 04bd66779a1f
child 1170 4697f23e0ede
debugobsconvert: also deduplicate markers in the process Various bug allowed identical or semantically identical marker to be added to the repository. So we also filter duplicates when converting.
hgext/evolve.py
--- a/hgext/evolve.py	Mon Oct 20 22:16:24 2014 -0400
+++ b/hgext/evolve.py	Thu Nov 20 15:33:14 2014 -0800
@@ -2765,7 +2765,14 @@
         msg = _('New format is the same as the old format, not upgrading!')
         raise util.Abort(msg)
     f = repo.sopener('obsstore', 'wb', atomictemp=True)
-    markers = repo.obsstore._all
+    origmarkers = repo.obsstore._all
+    known = set()
+    markers = []
+    for m in markers:
+        if m in known:
+            continue
+        know.add(m)
+        markers.append(m)
     ui.write(_('Old store is version %d, will rewrite in verion %d\n') % (
         repo.obsstore._version, new_format))
     map(f.write, obsolete.encodemarkers(markers, True, new_format))