comparison hgfastimport/hgimport.py @ 43:000d4174071c

Don't blow up if first parent == second parent. cvs2git produces this on purpose, and git-fast-import handles it. (backout changeset a1ccf1817b65)
author Greg Ward <greg-hg@gerg.ca>
date Mon, 11 May 2009 13:59:20 -0400
parents 71f1e5ed6213
children 61ff7b929cea
comparison
equal deleted inserted replaced
42:71f1e5ed6213 43:000d4174071c
128 #self.ui.write("foo") 128 #self.ui.write("foo")
129 if len(cmd.merges) > 1: 129 if len(cmd.merges) > 1:
130 raise NotImplementedError("Can't handle more than two parents") 130 raise NotImplementedError("Can't handle more than two parents")
131 second_parent = self.committish_rev(cmd.merges[0]) 131 second_parent = self.committish_rev(cmd.merges[0])
132 #self.ui.write("Second parent: %s\n" % second_parent) 132 #self.ui.write("Second parent: %s\n" % second_parent)
133 if second_parent == first_parent:
134 raise util.Abort("bad fastimport dump: commit %s has %s as "
135 "both parents"
136 % (cmd.id, cmd.merges[0]))
137
138 mercurial.commands.debugsetparents(self.ui, self.repo, 133 mercurial.commands.debugsetparents(self.ui, self.repo,
139 first_parent, second_parent) 134 first_parent, second_parent)
140 #self.ui.write("Bing\n") 135 #self.ui.write("Bing\n")
141 if cmd.ref == "refs/heads/master": 136 if cmd.ref == "refs/heads/master":
142 branch = "default" 137 branch = "default"