changeset 1169:6f08a8f6bb1d

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.
author Pierre-Yves David <pierre-yves.david@fb.com>
date Thu, 20 Nov 2014 15:33:14 -0800
parents 04bd66779a1f
children 4697f23e0ede
files hgext/evolve.py
diffstat 1 files changed, 8 insertions(+), 1 deletions(-) [+]
line wrap: on
line diff
--- 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))