diff hgext/convert/convcmd.py @ 16105:ebaa0aa749e2 stable

convert: turn splicemap into a simple dictionary Parsing the splicemap as a mapfile was a pain because map does not let us override its parsing code and splicemap entries are not key/values. Besides we had no need for mapfiles extra features. Just parse the splicemap and return a dictionary.
author Patrick Mezard <patrick@mezard.eu>
date Fri, 10 Feb 2012 22:25:49 +0100
parents 9ff22f600c6c
children d75aa756149b
line wrap: on
line diff
--- a/hgext/convert/convcmd.py	Fri Feb 10 14:46:09 2012 +0100
+++ b/hgext/convert/convcmd.py	Fri Feb 10 22:25:49 2012 +0100
@@ -15,7 +15,7 @@
 from gnuarch import gnuarch_source
 from bzr import bzr_source
 from p4 import p4_source
-import filemap
+import filemap, common
 
 import os, shutil
 from mercurial import hg, util, encoding
@@ -118,7 +118,7 @@
             self.readauthormap(opts.get('authormap'))
             self.authorfile = self.dest.authorfile()
 
-        self.splicemap = mapfile(ui, opts.get('splicemap'))
+        self.splicemap = common.parsesplicemap(opts.get('splicemap'))
         self.branchmap = mapfile(ui, opts.get('branchmap'))
 
     def walktree(self, heads):
@@ -319,7 +319,7 @@
                                   self.commitcache[prev].branch))
         self.dest.setbranch(commit.branch, pbranches)
         try:
-            parents = self.splicemap[rev].replace(',', ' ').split()
+            parents = self.splicemap[rev]
             self.ui.status(_('spliced in %s as parents of %s\n') %
                            (parents, rev))
             parents = [self.map.get(p, p) for p in parents]