changeset 46116:17a695357270

errors: use detailed exit code 50 for StorageError This is done as part of https://www.mercurial-scm.org/wiki/ErrorCategoriesPlan. Differential Revision: https://phab.mercurial-scm.org/D9601
author Martin von Zweigbergk <martinvonz@google.com>
date Wed, 09 Dec 2020 19:40:30 -0800
parents be3d8178251e
children 6cc269bd1c29
files mercurial/scmutil.py tests/test-bundle-r.t tests/test-bundle.t tests/test-committer.t tests/test-convert-filemap.t tests/test-flagprocessor.t tests/test-grep.t tests/test-init.t tests/test-lfs-serve-access.t tests/test-lfs-test-server.t tests/test-lfs.t tests/test-mq-qrefresh.t tests/test-pull-bundle.t tests/test-requires.t tests/test-revlog-v2.t tests/test-revlog.t tests/test-username-newline.t
diffstat 17 files changed, 32 insertions(+), 31 deletions(-) [+]
line wrap: on
line diff
--- a/mercurial/scmutil.py	Wed Dec 09 20:22:25 2020 -0800
+++ b/mercurial/scmutil.py	Wed Dec 09 19:40:30 2020 -0800
@@ -213,6 +213,7 @@
         ui.error(_(b"abort: %s\n") % inst)
         if inst.hint:
             ui.error(_(b"(%s)\n") % inst.hint)
+        detailed_exit_code = 50
     except error.InterventionRequired as inst:
         ui.error(b"%s\n" % inst)
         if inst.hint:
--- a/tests/test-bundle-r.t	Wed Dec 09 20:22:25 2020 -0800
+++ b/tests/test-bundle-r.t	Wed Dec 09 19:40:30 2020 -0800
@@ -224,7 +224,7 @@
   transaction abort!
   rollback completed
   abort: 00changelog.i@93ee6ab32777: unknown parent
-  [255]
+  [50]
 
 revision 2
 
--- a/tests/test-bundle.t	Wed Dec 09 20:22:25 2020 -0800
+++ b/tests/test-bundle.t	Wed Dec 09 19:40:30 2020 -0800
@@ -734,7 +734,7 @@
 
   $ hg -R bundle.hg verify
   abort: 00changelog.i@bbd179dfa0a7: unknown parent
-  [255]
+  [50]
 
 full history bundle, refuses to verify non-local repo
 
--- a/tests/test-committer.t	Wed Dec 09 20:22:25 2020 -0800
+++ b/tests/test-committer.t	Wed Dec 09 19:40:30 2020 -0800
@@ -103,7 +103,7 @@
   transaction abort!
   rollback completed
   abort: empty username
-  [255]
+  [50]
 
 # don't add tests here, previous test is unstable
 
--- a/tests/test-convert-filemap.t	Wed Dec 09 20:22:25 2020 -0800
+++ b/tests/test-convert-filemap.t	Wed Dec 09 19:40:30 2020 -0800
@@ -294,7 +294,7 @@
   $ hg -q convert --filemap renames.fmap --datesort source dummydest
   abort: data/dir/file3.i@e96dce0bc6a2: no match found (reporevlogstore !)
   abort: data/dir/file3/index@e96dce0bc6a2: no node (reposimplestore !)
-  [255]
+  [50]
   $ hg -q convert --filemap renames.fmap --datesort --config convert.hg.ignoreerrors=1 source renames.repo
   ignoring: data/dir/file3.i@e96dce0bc6a2: no match found (reporevlogstore !)
   ignoring: data/dir/file4.i@6edd55f559cd: no match found (reporevlogstore !)
--- a/tests/test-flagprocessor.t	Wed Dec 09 20:22:25 2020 -0800
+++ b/tests/test-flagprocessor.t	Wed Dec 09 19:40:30 2020 -0800
@@ -190,7 +190,7 @@
   $ echo '[FAIL][BASE64][GZIP][NOOP]' > fail-base64-gzip-noop
   $ hg commit -Aqm 'fail+base64+gzip+noop'
   abort: missing processor for flag '0x1'
-  [255]
+  [50]
   $ rm fail-base64-gzip-noop
 
 # TEST: ensure we cannot register several flag processors on the same flag
--- a/tests/test-grep.t	Wed Dec 09 20:22:25 2020 -0800
+++ b/tests/test-grep.t	Wed Dec 09 19:40:30 2020 -0800
@@ -1019,7 +1019,7 @@
   add0-cp4-mod4:2147483647:+:data4
   add0-mod4:2147483647:+:data4
   add0-rm4:2147483647:-:abort: add0-rm4@None: not found in manifest
-  [255]
+  [50]
 
   $ hg grep -fr'wdir()' data
   add0:2147483647:data0
--- a/tests/test-init.t	Wed Dec 09 20:22:25 2020 -0800
+++ b/tests/test-init.t	Wed Dec 09 19:40:30 2020 -0800
@@ -33,10 +33,10 @@
 
   $ hg --config format.chunkcachesize=0 log -R local -pv
   abort: revlog chunk cache size 0 is not greater than 0
-  [255]
+  [50]
   $ hg --config format.chunkcachesize=1023 log -R local -pv
   abort: revlog chunk cache size 1023 is not a power of 2
-  [255]
+  [50]
   $ hg --config format.chunkcachesize=1024 log -R local -pv
   changeset:   0:08b9e9f63b32
   tag:         tip
--- a/tests/test-lfs-serve-access.t	Wed Dec 09 20:22:25 2020 -0800
+++ b/tests/test-lfs-serve-access.t	Wed Dec 09 19:40:30 2020 -0800
@@ -32,7 +32,7 @@
   searching for changes
   abort: LFS HTTP error: HTTP Error 400: no such method: .git
   (check that lfs serving is enabled on http://localhost:$HGPORT/.git/info/lfs and "upload" is supported)
-  [255]
+  [50]
 
 ... so do a local push to make the data available.  Remove the blob from the
 default cache, so it attempts to download.
@@ -54,7 +54,7 @@
   updating to branch default
   abort: LFS HTTP error: HTTP Error 400: no such method: .git
   (check that lfs serving is enabled on http://localhost:$HGPORT/.git/info/lfs and "download" is supported)
-  [255]
+  [50]
 
   $ "$PYTHON" $RUNTESTDIR/killdaemons.py $DAEMON_PIDS
 
@@ -80,14 +80,14 @@
   $ hg -R httpclone update default --config lfs.url=http://localhost:$HGPORT/missing
   abort: LFS HTTP error: HTTP Error 404: Not Found
   (the "lfs.url" config may be used to override http://localhost:$HGPORT/missing)
-  [255]
+  [50]
 
   $ hg -R httpclone update default --config lfs.url=http://localhost:$HGPORT2/missing
   abort: LFS error: *onnection *refused* (glob) (?)
   abort: LFS error: $EADDRNOTAVAIL$ (glob) (?)
   abort: LFS error: No route to host (?)
   (the "lfs.url" config may be used to override http://localhost:$HGPORT2/missing)
-  [255]
+  [50]
 
 Blob URIs are correct when --prefix is used
 
@@ -267,7 +267,7 @@
   new changesets 525251863cad
   updating to branch default
   abort: LFS server error for "lfs.bin": Internal server error
-  [255]
+  [50]
 
 Test an I/O error in localstore.verify() (Batch API) with PUT
 
@@ -277,7 +277,7 @@
   pushing to http://localhost:$HGPORT1/
   searching for changes
   abort: LFS server error for "unknown": Internal server error
-  [255]
+  [50]
 TODO: figure out how to associate the file name in the error above
 
 Test a bad checksum sent by the client in the transfer API
@@ -286,7 +286,7 @@
   pushing to http://localhost:$HGPORT1/
   searching for changes
   abort: LFS HTTP error: HTTP Error 422: corrupt blob (oid=b5bb9d8014a0f9b1d61e21e796d78dccdf1352f23cd32812f4850b878ae4944c, action=upload)
-  [255]
+  [50]
 
   $ echo 'test lfs file' > server/lfs3.bin
   $ hg --config experimental.lfs.disableusercache=True \
@@ -298,14 +298,14 @@
   $ hg --config lfs.url=http://localhost:$HGPORT1/.git/info/lfs \
   >    -R client update -r tip
   abort: LFS HTTP error: HTTP Error 500: Internal Server Error (oid=276f73cfd75f9fb519810df5f5d96d6594ca2521abd86cbcd92122f7d51a1f3d, action=download)
-  [255]
+  [50]
 
 Test a checksum failure during the processing of the GET request
 
   $ hg --config lfs.url=http://localhost:$HGPORT1/.git/info/lfs \
   >    -R client update -r tip
   abort: LFS HTTP error: HTTP Error 422: corrupt blob (oid=276f73cfd75f9fb519810df5f5d96d6594ca2521abd86cbcd92122f7d51a1f3d, action=download)
-  [255]
+  [50]
 
   $ "$PYTHON" $RUNTESTDIR/killdaemons.py $DAEMON_PIDS
 
@@ -453,7 +453,7 @@
   searching for changes
   abort: LFS HTTP error: HTTP Error 401: the server must support Basic Authentication
   (api=http://localhost:$HGPORT1/.git/info/lfs/objects/batch, action=upload)
-  [255]
+  [50]
 
   $ hg -R auth_clone --debug push | egrep '^[{}]|  '
   {
--- a/tests/test-lfs-test-server.t	Wed Dec 09 20:22:25 2020 -0800
+++ b/tests/test-lfs-test-server.t	Wed Dec 09 19:40:30 2020 -0800
@@ -460,7 +460,7 @@
   Date: $HTTP_DATE$ (git-server !)
   abort: corrupt remote lfs object: d11e1a642b60813aee592094109b406089b8dff4cb157157f753418ec7857998 (git-server !)
   abort: LFS server error for "c": Validation error (hg-server !)
-  [255]
+  [50]
 
 The corrupted blob is not added to the usercache or local store
 
@@ -827,7 +827,7 @@
     "transfer": "basic" (hg-server !)
   }
   abort: LFS server error for "b": The object does not exist
-  [255]
+  [50]
 
 Check error message when object does not exist:
 
@@ -938,6 +938,6 @@
     "transfer": "basic" (hg-server !)
   }
   abort: LFS server error for "a": The object does not exist
-  [255]
+  [50]
 
   $ "$PYTHON" $RUNTESTDIR/killdaemons.py $DAEMON_PIDS
--- a/tests/test-lfs.t	Wed Dec 09 20:22:25 2020 -0800
+++ b/tests/test-lfs.t	Wed Dec 09 19:40:30 2020 -0800
@@ -986,7 +986,7 @@
 
   $ hg --cwd fromcorrupt2 cat -r 0 large
   abort: integrity check failed on data/large.i:0
-  [255]
+  [50]
 
 lfs -> normal -> lfs round trip conversions are possible.  The 'none()'
 predicate on the command line will override whatever is configured globally and
--- a/tests/test-mq-qrefresh.t	Wed Dec 09 20:22:25 2020 -0800
+++ b/tests/test-mq-qrefresh.t	Wed Dec 09 19:40:30 2020 -0800
@@ -505,7 +505,7 @@
   rollback completed
   qrefresh interrupted while patch was popped! (revert --all, qpush to recover)
   abort: username 'foo\nbar' contains a newline
-  [255]
+  [50]
   $ rm a
   $ cat .hg/patches/a
   # HG changeset patch
@@ -521,7 +521,7 @@
   rollback completed
   qrefresh interrupted while patch was popped! (revert --all, qpush to recover)
   abort: empty username
-  [255]
+  [50]
   $ cat .hg/patches/a
   # HG changeset patch
   # Parent  0000000000000000000000000000000000000000
--- a/tests/test-pull-bundle.t	Wed Dec 09 20:22:25 2020 -0800
+++ b/tests/test-pull-bundle.t	Wed Dec 09 19:40:30 2020 -0800
@@ -186,7 +186,7 @@
   adding manifests
   adding file changes
   abort: 00changelog.i@66f7d451a68b: no node
-  [255]
+  [50]
   $ cd ..
   $ killdaemons.py
   $ grep 'sending pullbundle ' repo/.hg/blackbox.log
--- a/tests/test-requires.t	Wed Dec 09 20:22:25 2020 -0800
+++ b/tests/test-requires.t	Wed Dec 09 19:40:30 2020 -0800
@@ -6,7 +6,7 @@
   $ rm .hg/requires
   $ hg tip
   abort: unknown version (2) in revlog 00changelog.i
-  [255]
+  [50]
   $ echo indoor-pool > .hg/requires
   $ hg tip
   abort: repository requires features unknown to this Mercurial: indoor-pool
--- a/tests/test-revlog-v2.t	Wed Dec 09 20:22:25 2020 -0800
+++ b/tests/test-revlog-v2.t	Wed Dec 09 19:40:30 2020 -0800
@@ -36,7 +36,7 @@
 
   $ hg log
   abort: unknown flags (0xff00) in version 57005 revlog 00changelog.i
-  [255]
+  [50]
 
   $ cd ..
 
--- a/tests/test-revlog.t	Wed Dec 09 20:22:25 2020 -0800
+++ b/tests/test-revlog.t	Wed Dec 09 19:40:30 2020 -0800
@@ -8,7 +8,7 @@
 
   $ hg log
   abort: unknown flags (0x01) in version 0 revlog 00changelog.i
-  [255]
+  [50]
 
 Unknown flags on revlog version 1 are rejected
 
@@ -17,7 +17,7 @@
 
   $ hg log
   abort: unknown flags (0x04) in version 1 revlog 00changelog.i
-  [255]
+  [50]
 
 Unknown version is rejected
 
@@ -26,7 +26,7 @@
 
   $ hg log
   abort: unknown version (2) in revlog 00changelog.i
-  [255]
+  [50]
 
   $ cd ..
 
--- a/tests/test-username-newline.t	Wed Dec 09 20:22:25 2020 -0800
+++ b/tests/test-username-newline.t	Wed Dec 09 19:40:30 2020 -0800
@@ -23,5 +23,5 @@
   transaction abort!
   rollback completed
   abort: username 'foo\nbar3' contains a newline
-  [255]
+  [50]