Patchwork D9328: errors: raise InputError when given non-existent paths etc

login
register
mail settings
Submitter phabricator
Date Nov. 17, 2020, 12:28 a.m.
Message ID <differential-rev-PHID-DREV-akytqtbwy6m3ur52grak-req@mercurial-scm.org>
Download mbox | patch
Permalink /patch/47606/
State Superseded
Headers show

Comments

phabricator - Nov. 17, 2020, 12:28 a.m.
martinvonz created this revision.
Herald added a reviewer: hg-reviewers.
Herald added a subscriber: mercurial-patches.

REPOSITORY
  rHG Mercurial

BRANCH
  default

REVISION DETAIL
  https://phab.mercurial-scm.org/D9328

AFFECTED FILES
  mercurial/cmdutil.py
  mercurial/localrepo.py
  tests/test-commit-interactive.t
  tests/test-commit.t
  tests/test-largefiles.t
  tests/test-symlinks.t

CHANGE DETAILS




To: martinvonz, #hg-reviewers
Cc: mercurial-patches, mercurial-devel

Patch

diff --git a/tests/test-symlinks.t b/tests/test-symlinks.t
--- a/tests/test-symlinks.t
+++ b/tests/test-symlinks.t
@@ -198,7 +198,7 @@ 
   $ ln -s nothing dangling
   $ hg commit -m 'commit symlink without adding' dangling
   abort: dangling: file not tracked!
-  [255]
+  [10]
   $ hg add dangling
   $ hg commit -m 'add symlink'
 
diff --git a/tests/test-largefiles.t b/tests/test-largefiles.t
--- a/tests/test-largefiles.t
+++ b/tests/test-largefiles.t
@@ -412,7 +412,7 @@ 
   $ hg revert --quiet z
   $ hg commit -m "Empty subdir" z
   abort: z: no match under directory!
-  [255]
+  [10]
   $ rm -rf z
   $ hg ci -m "standin" .hglf
   abort: file ".hglf" is a largefile standin
diff --git a/tests/test-commit.t b/tests/test-commit.t
--- a/tests/test-commit.t
+++ b/tests/test-commit.t
@@ -54,7 +54,7 @@ 
   [1]
   $ hg commit -m commit-8-2 bar
   abort: bar: file not found!
-  [255]
+  [10]
 
   $ hg -q revert -a --no-backup
 
@@ -74,7 +74,7 @@ 
   adding dir.file
   $ hg commit -m commit-10 dir dir.file
   abort: dir: no match under directory!
-  [255]
+  [10]
 
   $ echo >> dir/file
   $ mkdir bleh
@@ -82,10 +82,10 @@ 
   $ cd bleh
   $ hg commit -m commit-11 .
   abort: bleh: no match under directory!
-  [255]
+  [10]
   $ hg commit -m commit-12 ../dir ../dir2
   abort: dir2: no match under directory!
-  [255]
+  [10]
   $ hg -v commit -m commit-13 ../dir
   committing files:
   dir/file
@@ -96,20 +96,20 @@ 
 
   $ hg commit -m commit-14 does-not-exist
   abort: does-not-exist: * (glob)
-  [255]
+  [10]
 
 #if symlink
   $ ln -s foo baz
   $ hg commit -m commit-15 baz
   abort: baz: file not tracked!
-  [255]
+  [10]
   $ rm baz
 #endif
 
   $ touch quux
   $ hg commit -m commit-16 quux
   abort: quux: file not tracked!
-  [255]
+  [10]
   $ echo >> dir/file
   $ hg -v commit -m commit-17 dir/file
   committing files:
diff --git a/tests/test-commit-interactive.t b/tests/test-commit-interactive.t
--- a/tests/test-commit-interactive.t
+++ b/tests/test-commit-interactive.t
@@ -61,7 +61,7 @@ 
   $ touch untracked
   $ hg commit -i -m should-fail empty-rw untracked
   abort: untracked: file not tracked!
-  [255]
+  [10]
   $ rm untracked
 
 Record empty file
diff --git a/mercurial/localrepo.py b/mercurial/localrepo.py
--- a/mercurial/localrepo.py
+++ b/mercurial/localrepo.py
@@ -2845,7 +2845,7 @@ 
             extra = {}
 
         def fail(f, msg):
-            raise error.Abort(b'%s: %s' % (f, msg))
+            raise error.InputError(b'%s: %s' % (f, msg))
 
         if not match:
             match = matchmod.always()
diff --git a/mercurial/cmdutil.py b/mercurial/cmdutil.py
--- a/mercurial/cmdutil.py
+++ b/mercurial/cmdutil.py
@@ -459,7 +459,7 @@ 
             )
 
         def fail(f, msg):
-            raise error.Abort(b'%s: %s' % (f, msg))
+            raise error.InputError(b'%s: %s' % (f, msg))
 
         force = opts.get(b'force')
         if not force: