diff hgext/split.py @ 45876:568c05d8f3d2

errors: raise InputError in `hg split` Differential Revision: https://phab.mercurial-scm.org/D9338
author Martin von Zweigbergk <martinvonz@google.com>
date Tue, 17 Nov 2020 15:51:09 -0800
parents 8357e0e81bb7
children 7f6c002d7c0a
line wrap: on
line diff
--- a/hgext/split.py	Tue Nov 17 15:42:42 2020 -0800
+++ b/hgext/split.py	Tue Nov 17 15:51:09 2020 -0800
@@ -72,7 +72,7 @@
     with repo.wlock(), repo.lock(), repo.transaction(b'split') as tr:
         revs = scmutil.revrange(repo, revlist or [b'.'])
         if len(revs) > 1:
-            raise error.Abort(_(b'cannot split multiple revisions'))
+            raise error.InputError(_(b'cannot split multiple revisions'))
 
         rev = revs.first()
         ctx = repo[rev]
@@ -82,7 +82,7 @@
             ui.status(_(b'nothing to split\n'))
             return 1
         if ctx.node() is None:
-            raise error.Abort(_(b'cannot split working directory'))
+            raise error.InputError(_(b'cannot split working directory'))
 
         if opts.get(b'rebase'):
             # Skip obsoleted descendants and their descendants so the rebase
@@ -98,7 +98,7 @@
         rewriteutil.precheck(repo, [rev] + torebase, b'split')
 
         if len(ctx.parents()) > 1:
-            raise error.Abort(_(b'cannot split a merge changeset'))
+            raise error.InputError(_(b'cannot split a merge changeset'))
 
         cmdutil.bailifchanged(repo)
 
@@ -170,7 +170,7 @@
         committed.append(newctx)
 
     if not committed:
-        raise error.Abort(_(b'cannot split an empty revision'))
+        raise error.InputError(_(b'cannot split an empty revision'))
 
     scmutil.cleanupnodes(
         repo,