convert: pass the order of the revmapfile to the converter_source
The entries in this file are supposed to be topologically sorted and
this may be useful for a converter_source.
--- a/hgext/convert/__init__.py Thu Oct 04 19:47:22 2007 -0500
+++ b/hgext/convert/__init__.py Thu Oct 04 23:21:37 2007 -0300
@@ -53,11 +53,14 @@
self.authorfile = None
self.mapfile = filemapper
+ self.maporder = []
self.map = {}
try:
origrevmapfile = open(self.revmapfile, 'r')
for l in origrevmapfile:
sv, dv = l[:-1].split()
+ if sv not in self.map:
+ self.maporder.append(sv)
self.map[sv] = dv
origrevmapfile.close()
except IOError:
@@ -238,7 +241,7 @@
try:
self.source.before()
self.dest.before()
- self.source.setrevmap(self.map)
+ self.source.setrevmap(self.map, self.maporder)
self.ui.status("scanning source...\n")
heads = self.source.getheads()
parents = self.walktree(heads)
--- a/hgext/convert/common.py Thu Oct 04 19:47:22 2007 -0500
+++ b/hgext/convert/common.py Thu Oct 04 23:21:37 2007 -0300
@@ -44,8 +44,11 @@
def after(self):
pass
- def setrevmap(self, revmap):
- """set the map of already-converted revisions"""
+ def setrevmap(self, revmap, order):
+ """set the map of already-converted revisions
+
+ order is a list with the keys from revmap in the order they
+ appear in the revision map file."""
pass
def getheads(self):
--- a/hgext/convert/subversion.py Thu Oct 04 19:47:22 2007 -0500
+++ b/hgext/convert/subversion.py Thu Oct 04 23:21:37 2007 -0300
@@ -147,7 +147,7 @@
self.head = self.revid(self.last_changed)
- def setrevmap(self, revmap):
+ def setrevmap(self, revmap, order):
lastrevs = {}
for revid in revmap.keys():
uuid, module, revnum = self.revsplit(revid)