##// END OF EJS Templates
rebase: improve error and debug messages
Sune Foldager -
r9577:b91960ae default
parent child Browse files
Show More
@@ -381,9 +381,9 b' def buildstate(repo, dest, src, base, co'
381 if src:
381 if src:
382 commonbase = repo[src].ancestor(repo[dest])
382 commonbase = repo[src].ancestor(repo[dest])
383 if commonbase == repo[src]:
383 if commonbase == repo[src]:
384 raise util.Abort(_('cannot rebase an ancestor'))
384 raise util.Abort(_('source is ancestor of destination'))
385 if commonbase == repo[dest]:
385 if commonbase == repo[dest]:
386 raise util.Abort(_('cannot rebase a descendant'))
386 raise util.Abort(_('source is descendant of destination'))
387 source = repo[src].rev()
387 source = repo[src].rev()
388 else:
388 else:
389 if base:
389 if base:
@@ -392,12 +392,12 b' def buildstate(repo, dest, src, base, co'
392 cwd = repo['.'].rev()
392 cwd = repo['.'].rev()
393
393
394 if cwd == dest:
394 if cwd == dest:
395 repo.ui.debug('already working on current\n')
395 repo.ui.debug('source and destination are the same\n')
396 return None
396 return None
397
397
398 targetancestors = set(repo.changelog.ancestors(dest))
398 targetancestors = set(repo.changelog.ancestors(dest))
399 if cwd in targetancestors:
399 if cwd in targetancestors:
400 repo.ui.debug('already working on the current branch\n')
400 repo.ui.debug('source is ancestor of destination\n')
401 return None
401 return None
402
402
403 cwdancestors = set(repo.changelog.ancestors(cwd))
403 cwdancestors = set(repo.changelog.ancestors(cwd))
@@ -129,8 +129,8 b' o 0: A'
129
129
130 % These will fail
130 % These will fail
131 % E onto D - rebase onto an ancestor
131 % E onto D - rebase onto an ancestor
132 abort: cannot rebase a descendant
132 abort: source is descendant of destination
133 % D onto E - rebase onto a descendant
133 % D onto E - rebase onto a descendant
134 abort: cannot rebase an ancestor
134 abort: source is ancestor of destination
135 % E onto B - merge revision with both parents not in ancestors of target
135 % E onto B - merge revision with both parents not in ancestors of target
136 abort: cannot use revision 4 as base, result would have 3 parents
136 abort: cannot use revision 4 as base, result would have 3 parents
General Comments 0
You need to be logged in to leave comments. Login now