Mercurial > hg > hg-fastimport
comparison hgfastimport/hgimport.py @ 41:a1ccf1817b65
Abort if a commit has first parent == second parent.
| author | Greg Ward <greg-hg@gerg.ca> |
|---|---|
| date | Sun, 10 May 2009 10:27:18 -0400 |
| parents | 0eb03c70c8f0 |
| children | 71f1e5ed6213 |
comparison
equal
deleted
inserted
replaced
| 40:0eb03c70c8f0 | 41:a1ccf1817b65 |
|---|---|
| 119 #self.ui.write("foo") | 119 #self.ui.write("foo") |
| 120 if len(cmd.merges) > 1: | 120 if len(cmd.merges) > 1: |
| 121 raise NotImplementedError("Can't handle more than two parents") | 121 raise NotImplementedError("Can't handle more than two parents") |
| 122 second_parent = self.committish_rev(cmd.merges[0]) | 122 second_parent = self.committish_rev(cmd.merges[0]) |
| 123 #self.ui.write("Second parent: %s\n" % second_parent) | 123 #self.ui.write("Second parent: %s\n" % second_parent) |
| 124 if second_parent == first_parent: | |
| 125 raise util.Abort("bad fastimport dump: commit %s has %s as " | |
| 126 "both parents" | |
| 127 % (cmd.id, cmd.merges[0])) | |
| 128 | |
| 124 mercurial.commands.debugsetparents(self.ui, self.repo, | 129 mercurial.commands.debugsetparents(self.ui, self.repo, |
| 125 first_parent, second_parent) | 130 first_parent, second_parent) |
| 126 #self.ui.write("Bing\n") | 131 #self.ui.write("Bing\n") |
| 127 if cmd.ref == "refs/heads/master": | 132 if cmd.ref == "refs/heads/master": |
| 128 branch = "default" | 133 branch = "default" |
