Mercurial > hgsubversion
comparison util.py @ 221:ced45b753ba7
util: better error messages when finding svn parent of a revision.
author | Augie Fackler <durin42@gmail.com> |
---|---|
date | Sat, 28 Mar 2009 17:59:55 -0500 |
parents | df4611050286 |
children | 330f0b15d417 |
comparison
equal
deleted
inserted
replaced
220:06eb60f9a026 | 221:ced45b753ba7 |
---|---|
1 import os | 1 import os |
2 import shutil | 2 import shutil |
3 | 3 |
4 from mercurial import hg | 4 from mercurial import hg |
5 from mercurial import node | 5 from mercurial import node |
6 from mercurial import util | |
6 | 7 |
7 svn_subcommands = { } | 8 svn_subcommands = { } |
8 def register_subcommand(name): | 9 def register_subcommand(name): |
9 def inner(fn): | 10 def inner(fn): |
10 svn_subcommands[name] = fn | 11 svn_subcommands[name] = fn |
92 sourcerev = repo[sourcerev] | 93 sourcerev = repo[sourcerev] |
93 while (not sourcerev.node() in reverse_map | 94 while (not sourcerev.node() in reverse_map |
94 and sourcerev.node() != node.nullid): | 95 and sourcerev.node() != node.nullid): |
95 outgoing_rev_hashes.append(sourcerev.node()) | 96 outgoing_rev_hashes.append(sourcerev.node()) |
96 sourcerev = sourcerev.parents() | 97 sourcerev = sourcerev.parents() |
97 assert len(sourcerev) == 1 | 98 if len(sourcerev) != 1: |
99 raise util.Abort("Sorry, can't find svn parent of a merge revision.") | |
98 sourcerev = sourcerev[0] | 100 sourcerev = sourcerev[0] |
99 if sourcerev.node() != node.nullid: | 101 if sourcerev.node() != node.nullid: |
100 return outgoing_rev_hashes | 102 return outgoing_rev_hashes |
101 | 103 |
102 def build_extra(revnum, branch, uuid, subdir): | 104 def build_extra(revnum, branch, uuid, subdir): |