Commits

Pierre-Yves David committed 4a5488c

obsolete: improve compat with new core dump%i scheme

  • Participants
  • Parent commits 9dda5c1
  • Tags 0.6

Comments (0)

Files changed (1)

hgext/obsolete.py

     if not repo.obsstore:
         return {}
     data = repo.obsstore._writemarkers()
-    return {'dump': base85.b85encode(data)}
+    encdata = base85.b85encode(data)
+    return {'dump0': encdata,
+            'dump': encdata} # legacy compat
 
 def pushmarker(repo, key, old, new):
     """Push markers over pushkey"""
                 result = opull(remote, *args, **kwargs)
                 remoteobs = remote.listkeys('obsolete')
                 if 'dump' in remoteobs:
-                    data = base85.b85decode(remoteobs['dump'])
-                    self.obsstore.mergemarkers(data)
+                    remoteobs['dump0'] = remoteobs.pop('dump')
+                if 'dump0' in remoteobs:
+                    for key, values in remoteobs.iteritems():
+                        if key.startswith('dump'):
+                            data = base85.b85decode(remoteobs['dump0'])
+                            self.obsstore.mergemarkers(data)
                     self._clearobsoletecache()
                     self._turn_extinct_secret()
                     return result
                 raise
             if 'obsolete' in remote.listkeys('namespaces') and self.obsstore:
                 data = self.obsstore._writemarkers()
-                r = remote.pushkey('obsolete', 'dump', '',
+                r = remote.pushkey('obsolete', 'dump0', '',
                                    base85.b85encode(data))
                 if not r:
                     self.ui.warn(_('failed to push obsolete markers!\n'))