diff hgext/rebase.py @ 27577:f9e755736b0e

rebase: better error message when rebased changes are all in destination Before this patch, when rebasing a set of obsolete revisions that were plain pruned or already present in the destination, we were displaying: abort: no matching revisions This was not very helpful to understand what was going on, instead we replace the error message by: abort: all requested changesets have equivalents or were marked as obsolete (to force the rebase, set the config experimental.rebaseskipobsolete to False)
author Laurent Charignon <lcharignon@fb.com>
date Tue, 29 Dec 2015 15:32:12 -0800
parents d39e743e3578
children 42910f9fffeb
line wrap: on
line diff
--- a/hgext/rebase.py	Wed Dec 30 13:10:53 2015 -0800
+++ b/hgext/rebase.py	Tue Dec 29 15:32:12 2015 -0800
@@ -348,6 +348,13 @@
                 # - split changesets are not rebased if at least one of the
                 # changeset resulting from the split is an ancestor of dest
                 rebaseset = rebasesetrevs - set(obsoletenotrebased)
+                if rebasesetrevs and not rebaseset:
+                    msg = _('all requested changesets have equivalents '
+                            'or were marked as obsolete')
+                    hint = _('to force the rebase, set the config '
+                             'experimental.rebaseskipobsolete to False')
+                    raise error.Abort(msg, hint=hint)
+
             result = buildstate(repo, dest, rebaseset, collapsef,
                                 obsoletenotrebased)