changeset 45847:d68618954ade

errors: use InputError for some errors on `hg clone` Differential Revision: https://phab.mercurial-scm.org/D9329
author Martin von Zweigbergk <martinvonz@google.com>
date Thu, 12 Nov 2020 15:28:06 -0800
parents 96ca817ec192
children b56feaa9b520
files mercurial/hg.py tests/test-bundle.t tests/test-clone.t tests/test-http-clone-r.t tests/test-ssh-bundle1.t tests/test-ssh.t
diffstat 6 files changed, 11 insertions(+), 11 deletions(-) [+]
line wrap: on
line diff
--- a/mercurial/hg.py	Thu Nov 12 13:22:40 2020 -0800
+++ b/mercurial/hg.py	Thu Nov 12 15:28:06 2020 -0800
@@ -683,14 +683,14 @@
     source = util.urllocalpath(source)
 
     if not dest:
-        raise error.Abort(_(b"empty destination path is not valid"))
+        raise error.InputError(_(b"empty destination path is not valid"))
 
     destvfs = vfsmod.vfs(dest, expandpath=True)
     if destvfs.lexists():
         if not destvfs.isdir():
-            raise error.Abort(_(b"destination '%s' already exists") % dest)
+            raise error.InputError(_(b"destination '%s' already exists") % dest)
         elif destvfs.listdir():
-            raise error.Abort(_(b"destination '%s' is not empty") % dest)
+            raise error.InputError(_(b"destination '%s' is not empty") % dest)
 
     createopts = {}
     narrow = False
--- a/tests/test-bundle.t	Thu Nov 12 13:22:40 2020 -0800
+++ b/tests/test-bundle.t	Thu Nov 12 15:28:06 2020 -0800
@@ -601,7 +601,7 @@
 
   $ hg clone full.hg ''
   abort: empty destination path is not valid
-  [255]
+  [10]
 
 test for https://bz.mercurial-scm.org/216
 
--- a/tests/test-clone.t	Thu Nov 12 13:22:40 2020 -0800
+++ b/tests/test-clone.t	Thu Nov 12 15:28:06 2020 -0800
@@ -73,7 +73,7 @@
 
   $ hg clone . ''
   abort: empty destination path is not valid
-  [255]
+  [10]
 
 No update, with debug option:
 
@@ -189,7 +189,7 @@
 
   $ hg clone --pull a ''
   abort: empty destination path is not valid
-  [255]
+  [10]
 
 Clone to '.':
 
@@ -676,7 +676,7 @@
   $ hg clone q
   destination directory: q
   abort: destination 'q' is not empty
-  [255]
+  [10]
 
 destination directory not empty
 
@@ -684,7 +684,7 @@
   $ echo stuff > a/a
   $ hg clone q a
   abort: destination 'a' is not empty
-  [255]
+  [10]
 
 
 #if unix-permissions no-root
--- a/tests/test-http-clone-r.t	Thu Nov 12 13:22:40 2020 -0800
+++ b/tests/test-http-clone-r.t	Thu Nov 12 15:28:06 2020 -0800
@@ -217,6 +217,6 @@
 
   $ hg clone http://localhost:$HGPORT/
   abort: empty destination path is not valid
-  [255]
+  [10]
 
   $ cat error.log
--- a/tests/test-ssh-bundle1.t	Thu Nov 12 13:22:40 2020 -0800
+++ b/tests/test-ssh-bundle1.t	Thu Nov 12 15:28:06 2020 -0800
@@ -367,7 +367,7 @@
   $ hg clone --ssh "\"$PYTHON\" \"$TESTDIR/dummyssh\"" "ssh://user@dummy/a repo"
   destination directory: a repo
   abort: destination 'a repo' is not empty
-  [255]
+  [10]
 
 Test hg-ssh using a helper script that will restore PYTHONPATH (which might
 have been cleared by a hg.exe wrapper) and invoke hg-ssh with the right
--- a/tests/test-ssh.t	Thu Nov 12 13:22:40 2020 -0800
+++ b/tests/test-ssh.t	Thu Nov 12 15:28:06 2020 -0800
@@ -387,7 +387,7 @@
   $ hg clone --ssh "\"$PYTHON\" \"$TESTDIR/dummyssh\"" "ssh://user@dummy/a repo"
   destination directory: a repo
   abort: destination 'a repo' is not empty
-  [255]
+  [10]
 
 Make sure hg is really paranoid in serve --stdio mode. It used to be
 possible to get a debugger REPL by specifying a repo named --debugger.