Patchwork D9601: errors: use detailed exit code 50 for StorageError

login
register
mail settings
Submitter phabricator
Date Dec. 14, 2020, 9:33 p.m.
Message ID <differential-rev-PHID-DREV-ocdwegn43mfdqlxeksec-req@mercurial-scm.org>
Download mbox | patch
Permalink /patch/47900/
State Superseded
Headers show

Comments

phabricator - Dec. 14, 2020, 9:33 p.m.
martinvonz created this revision.
Herald added a reviewer: hg-reviewers.
Herald added a subscriber: mercurial-patches.

REVISION SUMMARY
  This is done as part of
  https://www.mercurial-scm.org/wiki/ErrorCategoriesPlan.

REPOSITORY
  rHG Mercurial

BRANCH
  default

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

AFFECTED 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

CHANGE DETAILS




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

Patch

diff --git a/tests/test-username-newline.t b/tests/test-username-newline.t
--- a/tests/test-username-newline.t
+++ b/tests/test-username-newline.t
@@ -23,5 +23,5 @@ 
   transaction abort!
   rollback completed
   abort: username 'foo\nbar3' contains a newline
-  [255]
+  [50]
 
diff --git a/tests/test-revlog.t b/tests/test-revlog.t
--- a/tests/test-revlog.t
+++ b/tests/test-revlog.t
@@ -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 ..
 
diff --git a/tests/test-revlog-v2.t b/tests/test-revlog-v2.t
--- a/tests/test-revlog-v2.t
+++ b/tests/test-revlog-v2.t
@@ -36,7 +36,7 @@ 
 
   $ hg log
   abort: unknown flags (0xff00) in version 57005 revlog 00changelog.i
-  [255]
+  [50]
 
   $ cd ..
 
diff --git a/tests/test-requires.t b/tests/test-requires.t
--- a/tests/test-requires.t
+++ b/tests/test-requires.t
@@ -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
diff --git a/tests/test-pull-bundle.t b/tests/test-pull-bundle.t
--- a/tests/test-pull-bundle.t
+++ b/tests/test-pull-bundle.t
@@ -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
diff --git a/tests/test-mq-qrefresh.t b/tests/test-mq-qrefresh.t
--- a/tests/test-mq-qrefresh.t
+++ b/tests/test-mq-qrefresh.t
@@ -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
diff --git a/tests/test-lfs.t b/tests/test-lfs.t
--- a/tests/test-lfs.t
+++ b/tests/test-lfs.t
@@ -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
diff --git a/tests/test-lfs-test-server.t b/tests/test-lfs-test-server.t
--- a/tests/test-lfs-test-server.t
+++ b/tests/test-lfs-test-server.t
@@ -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
diff --git a/tests/test-lfs-serve-access.t b/tests/test-lfs-serve-access.t
--- a/tests/test-lfs-serve-access.t
+++ b/tests/test-lfs-serve-access.t
@@ -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 '^[{}]|  '
   {
diff --git a/tests/test-init.t b/tests/test-init.t
--- a/tests/test-init.t
+++ b/tests/test-init.t
@@ -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
diff --git a/tests/test-grep.t b/tests/test-grep.t
--- a/tests/test-grep.t
+++ b/tests/test-grep.t
@@ -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
diff --git a/tests/test-flagprocessor.t b/tests/test-flagprocessor.t
--- a/tests/test-flagprocessor.t
+++ b/tests/test-flagprocessor.t
@@ -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
diff --git a/tests/test-convert-filemap.t b/tests/test-convert-filemap.t
--- a/tests/test-convert-filemap.t
+++ b/tests/test-convert-filemap.t
@@ -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 !)
diff --git a/tests/test-committer.t b/tests/test-committer.t
--- a/tests/test-committer.t
+++ b/tests/test-committer.t
@@ -103,7 +103,7 @@ 
   transaction abort!
   rollback completed
   abort: empty username
-  [255]
+  [50]
 
 # don't add tests here, previous test is unstable
 
diff --git a/tests/test-bundle.t b/tests/test-bundle.t
--- a/tests/test-bundle.t
+++ b/tests/test-bundle.t
@@ -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
 
diff --git a/tests/test-bundle-r.t b/tests/test-bundle-r.t
--- a/tests/test-bundle-r.t
+++ b/tests/test-bundle-r.t
@@ -224,7 +224,7 @@ 
   transaction abort!
   rollback completed
   abort: 00changelog.i@93ee6ab32777: unknown parent
-  [255]
+  [50]
 
 revision 2
 
diff --git a/mercurial/scmutil.py b/mercurial/scmutil.py
--- a/mercurial/scmutil.py
+++ b/mercurial/scmutil.py
@@ -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: