This instance will be upgraded to Heptapod 0.21.0rc3 on 2021-04-23 at 10:30 UTC+2 (a few minutes of down time)

Commit 01be3092 authored by Martin von Zweigbergk's avatar Martin von Zweigbergk

errors: set detailed exit code to 100 for some remote errors

This is per https://www.mercurial-scm.org/wiki/ErrorCategoriesPlan.

Differential Revision: https://phab.mercurial-scm.org/D9309
parent ae00e170f2d1
......@@ -182,6 +182,7 @@ def callcatch(ui, func):
)
)
except error.OutOfBandError as inst:
detailed_exit_code = 100
if inst.args:
msg = _(b"abort: remote error:\n")
else:
......@@ -237,8 +238,10 @@ def callcatch(ui, func):
elif m in b"zlib".split():
ui.error(_(b"(is your Python install correct?)\n"))
except util.urlerr.httperror as inst:
detailed_exit_code = 100
ui.error(_(b"abort: %s\n") % stringutil.forcebytestr(inst))
except util.urlerr.urlerror as inst:
detailed_exit_code = 100
try: # usually it is in the form (errno, strerror)
reason = inst.reason.args[1]
except (AttributeError, IndexError):
......
......@@ -2,7 +2,7 @@
$ hg clone http://localhost:$HGPORT/ copy
abort: * (glob)
[255]
[100]
$ test -d copy
[1]
......@@ -11,5 +11,5 @@
$ cat dumb.pid >> $DAEMON_PIDS
$ hg clone http://localhost:$HGPORT/foo copy2
abort: HTTP Error 404: * (glob)
[255]
[100]
$ killdaemons.py
......@@ -987,7 +987,7 @@ Servers can disable bundle1 for clone/pull operations
abort: remote error:
incompatible Mercurial client; bundle2 required
(see https://www.mercurial-scm.org/wiki/IncompatibleClient)
[255]
[100]
$ killdaemons.py
$ cd ..
......@@ -1032,7 +1032,7 @@ bundle1 pull can be disabled for generaldelta repos only
abort: remote error:
incompatible Mercurial client; bundle2 required
(see https://www.mercurial-scm.org/wiki/IncompatibleClient)
[255]
[100]
$ killdaemons.py
......@@ -1050,7 +1050,7 @@ Verify the global server.bundle1 option works
abort: remote error:
incompatible Mercurial client; bundle2 required
(see https://www.mercurial-scm.org/wiki/IncompatibleClient)
[255]
[100]
$ killdaemons.py
$ hg --config devel.legacy.exchange=bundle1 clone ssh://user@dummy/bundle2onlyserver not-bundle2-ssh
......@@ -1075,7 +1075,7 @@ Verify the global server.bundle1 option works
abort: remote error:
incompatible Mercurial client; bundle2 required
(see https://www.mercurial-scm.org/wiki/IncompatibleClient)
[255]
[100]
$ killdaemons.py
......@@ -1132,7 +1132,7 @@ Verify bundle1 pushes can be disabled
abort: remote error:
incompatible Mercurial client; bundle2 required
(see https://www.mercurial-scm.org/wiki/IncompatibleClient)
[255]
[100]
(also check with ssh)
......
......@@ -618,7 +618,7 @@ Invalid URL
$ hg clone http://invalid:url/a b
abort: error: nonnumeric port: 'url'
[255]
[100]
No remote source
......@@ -629,7 +629,7 @@ No remote source
#else
$ hg clone http://$LOCALIP:3121/a b
abort: error: *refused* (glob)
[255]
[100]
#endif
$ rm -rf b # work around bug with http clone
......
......@@ -113,7 +113,7 @@ we don't fix up relative file URLs, but we do run shell commands in repo root
$ cd sub
$ hg log -qr "extdata(filedata)"
abort: error: $ENOENT$
[255]
[100]
$ hg log -qr "extdata(shelldata)"
2:f6ed99a58333
......
......@@ -41,7 +41,7 @@ Failure to accept() socket should result in connection related error message
$ hg clone http://localhost:$HGPORT/ clone
abort: error: (\$ECONNRESET\$|\$EADDRNOTAVAIL\$) (re)
[255]
[100]
(The server exits on its own, but there is a race between that and starting a new server.
So ensure the process is dead.)
......@@ -63,7 +63,7 @@ The flakiness in this output was observable easily with
--runs-per-test=20 on macOS 10.12 during the freeze for 4.2.
$ hg clone http://localhost:$HGPORT/ clone
abort: error: * (glob)
[255]
[100]
$ killdaemons.py $DAEMON_PIDS
......@@ -74,7 +74,7 @@ Failure to read all bytes in initial HTTP request should yield connection relate
$ hg clone http://localhost:$HGPORT/ clone
abort: error: bad HTTP status line: * (glob)
[255]
[100]
$ killdaemons.py $DAEMON_PIDS
......@@ -90,7 +90,7 @@ Same failure, but server reads full HTTP request line
$ cat hg.pid > $DAEMON_PIDS
$ hg clone http://localhost:$HGPORT/ clone
abort: error: bad HTTP status line: * (glob)
[255]
[100]
$ killdaemons.py $DAEMON_PIDS
......@@ -107,7 +107,7 @@ Failure on subsequent HTTP request on the same socket (cmd?batch)
$ cat hg.pid > $DAEMON_PIDS
$ hg clone http://localhost:$HGPORT/ clone
abort: error: bad HTTP status line: * (glob)
[255]
[100]
$ killdaemons.py $DAEMON_PIDS
......@@ -150,7 +150,7 @@ Failure to read getbundle HTTP request
$ hg clone http://localhost:$HGPORT/ clone
requesting all changes
abort: error: bad HTTP status line: * (glob)
[255]
[100]
$ killdaemons.py $DAEMON_PIDS
......@@ -217,7 +217,7 @@ Now do a variation using POST to send arguments
$ hg clone http://localhost:$HGPORT/ clone
abort: error: bad HTTP status line: * (glob)
[255]
[100]
$ killdaemons.py $DAEMON_PIDS
......@@ -277,7 +277,7 @@ Server sends a single character from the HTTP response line
$ hg clone http://localhost:$HGPORT/ clone
abort: error: bad HTTP status line: H
[255]
[100]
$ killdaemons.py $DAEMON_PIDS
......
......@@ -178,7 +178,7 @@ clone from invalid URL
$ hg clone http://localhost:$HGPORT/bad
abort: HTTP Error 404: Not Found
[255]
[100]
test http authentication
+ use the same server to test server side streaming preference
......@@ -250,7 +250,7 @@ test http authentication
[255]
$ hg id http://user:pass2@localhost:$HGPORT2/
abort: HTTP Error 403: no
[255]
[100]
$ hg -R dest-pull tag -r tip top
$ hg -R dest-pull push http://user:pass@localhost:$HGPORT2/
......@@ -338,7 +338,7 @@ clone of serve with repo in root and unserved subrepo (issue2970)
updating to branch default
cloning subrepo sub from http://localhost:$HGPORT/sub
abort: HTTP Error 404: Not Found
[255]
[100]
$ hg clone http://localhost:$HGPORT/ slash-clone
requesting all changes
adding changesets
......@@ -349,7 +349,7 @@ clone of serve with repo in root and unserved subrepo (issue2970)
updating to branch default
cloning subrepo sub from http://localhost:$HGPORT/sub
abort: HTTP Error 404: Not Found
[255]
[100]
check error log
......@@ -364,7 +364,7 @@ Check error reporting while pulling/cloning
requesting all changes
abort: remote error:
this is an exercise
[255]
[100]
$ cat error.log
disable pull-based clones
......@@ -375,7 +375,7 @@ disable pull-based clones
requesting all changes
abort: remote error:
server has pull-based clones disabled
[255]
[100]
#if no-reposimplestore
... but keep stream clones working
......
......@@ -874,13 +874,13 @@ Reset server to remove REQUEST_METHOD hack to test hg client
searching for changes
no changes found
abort: HTTP Error 403: ssl required
[255]
[100]
$ hg --cwd ../test2 push http://localhost:$HGPORT/
pushing to http://localhost:$HGPORT/
searching for changes
abort: HTTP Error 403: ssl required
[255]
[100]
$ killdaemons.py
......
......@@ -91,7 +91,7 @@ misconfigured hosts)
$ http_proxy=localhost:$HGPORT2 hg clone --config http_proxy.always=True http://localhost:$HGPORT/ f
abort: error: (Connection refused|Protocol not supported|.* actively refused it|\$EADDRNOTAVAIL\$|No route to host) (re)
[255]
[100]
do not use the proxy if it is in the no list
......
......@@ -167,7 +167,7 @@ clone from invalid URL
$ hg clone http://localhost:$HGPORT/bad
abort: HTTP Error 404: Not Found
[255]
[100]
test http authentication
+ use the same server to test server side streaming preference
......@@ -283,7 +283,7 @@ test http authentication
[255]
$ hg id http://user:pass2@localhost:$HGPORT2/
abort: HTTP Error 403: no
[255]
[100]
$ hg -R dest-pull tag -r tip top
$ hg -R dest-pull push http://user:pass@localhost:$HGPORT2/
......@@ -475,7 +475,7 @@ clone of serve with repo in root and unserved subrepo (issue2970)
updating to branch default
cloning subrepo sub from http://localhost:$HGPORT/sub
abort: HTTP Error 404: Not Found
[255]
[100]
$ hg clone http://localhost:$HGPORT/ slash-clone
requesting all changes
adding changesets
......@@ -486,7 +486,7 @@ clone of serve with repo in root and unserved subrepo (issue2970)
updating to branch default
cloning subrepo sub from http://localhost:$HGPORT/sub
abort: HTTP Error 404: Not Found
[255]
[100]
check error log
......@@ -588,7 +588,7 @@ Request without cookie sent should fail due to lack of cookie
$ hg id http://localhost:$HGPORT
abort: HTTP Error 500: no-cookie
[255]
[100]
Populate a cookies file
......@@ -602,7 +602,7 @@ Should not send a cookie for another domain
$ hg --config auth.cookiefile=cookies.txt id http://localhost:$HGPORT/
abort: HTTP Error 500: no-cookie
[255]
[100]
Add a cookie entry for our test server and verify it is sent
......@@ -612,4 +612,4 @@ Add a cookie entry for our test server and verify it is sent
$ hg --config auth.cookiefile=cookies.txt id http://localhost:$HGPORT/
abort: HTTP Error 500: Cookie: hgkey=localhostvalue
[255]
[100]
......@@ -59,7 +59,7 @@ we are able to load CA certs.
$ hg clone https://localhost:$HGPORT/ copy-pull
(the full certificate chain may not be available locally; see "hg help debugssl") (windows !)
abort: error: *certificate verify failed* (glob)
[255]
[100]
#endif
Specifying a per-host certificate file that doesn't exist will abort. The full
......@@ -84,7 +84,7 @@ A per-host certificate mismatching the server will fail verification
(an attempt was made to load CA certificates but none were loaded; see https://mercurial-scm.org/wiki/SecureConnections for how to configure Mercurial to avoid this error)
(the full certificate chain may not be available locally; see "hg help debugssl") (windows !)
abort: error: *certificate verify failed* (glob)
[255]
[100]
A per-host certificate matching the server's cert will be accepted
......@@ -238,7 +238,7 @@ cacert mismatch
pulling from https://localhost:$HGPORT/
(the full certificate chain may not be available locally; see "hg help debugssl") (windows !)
abort: error: *certificate verify failed* (glob)
[255]
[100]
$ hg -R copy-pull pull --config web.cacerts="$CERTSDIR/pub-other.pem" \
> --insecure
pulling from https://localhost:$HGPORT/
......@@ -255,7 +255,7 @@ Test server cert which isn't valid yet
pulling from https://localhost:$HGPORT1/
(the full certificate chain may not be available locally; see "hg help debugssl") (windows !)
abort: error: *certificate verify failed* (glob)
[255]
[100]
Test server cert which no longer is valid
......@@ -266,7 +266,7 @@ Test server cert which no longer is valid
pulling from https://localhost:$HGPORT2/
(the full certificate chain may not be available locally; see "hg help debugssl") (windows !)
abort: error: *certificate verify failed* (glob)
[255]
[100]
Setting ciphers to an invalid value aborts
$ P="$CERTSDIR" hg --config hostsecurity.ciphers=invalid -R copy-pull id https://localhost:$HGPORT/
......@@ -375,26 +375,26 @@ Clients requiring newer TLS version than what server supports fail
(consider contacting the operator of this server and ask them to support modern TLS protocol versions; or, set hostsecurity.localhost:minimumprotocol=tls1.0 to allow use of legacy, less secure protocols when communicating with this server)
(see https://mercurial-scm.org/wiki/SecureConnections for more info)
abort: error: .*(unsupported protocol|wrong ssl version).* (re)
[255]
[100]
$ P="$CERTSDIR" hg --config hostsecurity.minimumprotocol=tls1.1 id https://localhost:$HGPORT/
(could not negotiate a common security protocol (tls1.1+) with localhost; the likely cause is Mercurial is configured to be more secure than the server can support)
(consider contacting the operator of this server and ask them to support modern TLS protocol versions; or, set hostsecurity.localhost:minimumprotocol=tls1.0 to allow use of legacy, less secure protocols when communicating with this server)
(see https://mercurial-scm.org/wiki/SecureConnections for more info)
abort: error: .*(unsupported protocol|wrong ssl version).* (re)
[255]
[100]
$ P="$CERTSDIR" hg --config hostsecurity.minimumprotocol=tls1.2 id https://localhost:$HGPORT/
(could not negotiate a common security protocol (tls1.2+) with localhost; the likely cause is Mercurial is configured to be more secure than the server can support)
(consider contacting the operator of this server and ask them to support modern TLS protocol versions; or, set hostsecurity.localhost:minimumprotocol=tls1.0 to allow use of legacy, less secure protocols when communicating with this server)
(see https://mercurial-scm.org/wiki/SecureConnections for more info)
abort: error: .*(unsupported protocol|wrong ssl version).* (re)
[255]
[100]
$ P="$CERTSDIR" hg --config hostsecurity.minimumprotocol=tls1.2 id https://localhost:$HGPORT1/
(could not negotiate a common security protocol (tls1.2+) with localhost; the likely cause is Mercurial is configured to be more secure than the server can support)
(consider contacting the operator of this server and ask them to support modern TLS protocol versions; or, set hostsecurity.localhost:minimumprotocol=tls1.0 to allow use of legacy, less secure protocols when communicating with this server)
(see https://mercurial-scm.org/wiki/SecureConnections for more info)
abort: error: .*(unsupported protocol|wrong ssl version).* (re)
[255]
[100]
--insecure will allow TLS 1.0 connections and override configs
......@@ -417,7 +417,7 @@ The per-host config option by itself works
(consider contacting the operator of this server and ask them to support modern TLS protocol versions; or, set hostsecurity.localhost:minimumprotocol=tls1.0 to allow use of legacy, less secure protocols when communicating with this server)
(see https://mercurial-scm.org/wiki/SecureConnections for more info)
abort: error: .*(unsupported protocol|wrong ssl version).* (re)
[255]
[100]
.hg/hgrc file [hostsecurity] settings are applied to remote ui instances (issue5305)
......@@ -430,7 +430,7 @@ The per-host config option by itself works
(consider contacting the operator of this server and ask them to support modern TLS protocol versions; or, set hostsecurity.localhost:minimumprotocol=tls1.0 to allow use of legacy, less secure protocols when communicating with this server)
(see https://mercurial-scm.org/wiki/SecureConnections for more info)
abort: error: .*(unsupported protocol|wrong ssl version).* (re)
[255]
[100]
$ killdaemons.py hg0.pid
$ killdaemons.py hg1.pid
......@@ -482,13 +482,13 @@ Test https with cert problems through proxy
pulling from https://localhost:$HGPORT/
(the full certificate chain may not be available locally; see "hg help debugssl") (windows !)
abort: error: *certificate verify failed* (glob)
[255]
[100]
$ http_proxy=http://localhost:$HGPORT1/ hg -R copy-pull pull \
> --config web.cacerts="$CERTSDIR/pub-expired.pem" https://localhost:$HGPORT2/
pulling from https://localhost:$HGPORT2/
(the full certificate chain may not be available locally; see "hg help debugssl") (windows !)
abort: error: *certificate verify failed* (glob)
[255]
[100]
$ killdaemons.py hg0.pid
......@@ -518,7 +518,7 @@ without client certificate:
$ P="$CERTSDIR" hg id https://localhost:$HGPORT/
abort: error: .*(\$ECONNRESET\$|certificate required|handshake failure).* (re)
[255]
[100]
with client certificate:
......@@ -539,7 +539,7 @@ with client certificate:
$ env P="$CERTSDIR" hg id https://localhost:$HGPORT/
abort: error: * (glob)
[255]
[100]
Missing certficate and key files result in error
......
......@@ -117,7 +117,7 @@ exit code with nothing outgoing (issue3611)
This repository uses the largefiles extension.
Please enable it in your Mercurial config file.
[255]
[100]
used all HGPORTs, kill all daemons
$ killdaemons.py
......@@ -133,7 +133,7 @@ vanilla clients locked out from largefiles ssh repos
remote: -
abort: remote error
(check previous remote output)
[255]
[100]
#if serve
......
......@@ -41,7 +41,7 @@ expect ssl error
searching for changes
abort: HTTP Error 403: ssl required
% serve errors
[255]
[100]
expect authorization error
......
......@@ -90,10 +90,10 @@ With out of bounds accesses
$ hg id http://localhost:$HGPORT/some/dir7
abort: HTTP Error 404: Not Found
[255]
[100]
$ hg id http://localhost:$HGPORT/some
abort: HTTP Error 404: Not Found
[255]
[100]
$ cat access.log errors.log
$LOCALIP - - [$LOGDATE$] "GET /some/dir7?cmd=capabilities HTTP/1.1" 404 - (glob)
......
......@@ -2,7 +2,7 @@
$ hg clone http://localhost:$HGPORT/ copy
abort: * (glob)
[255]
[100]
$ test -d copy
[1]
......
......@@ -110,7 +110,7 @@ are also available as siblings of 'main'.
updating to branch default
cloning subrepo sub1 from http://localhost:$HGPORT/../sub1
abort: HTTP Error 404: Not Found
[255]
[100]
$ cat access.log
* "GET /?cmd=capabilities HTTP/1.1" 200 - (glob)
......
......@@ -85,7 +85,7 @@ just masked out, and that would make the hashed URL different.
searching for changes
no changes found
abort: HTTP Error 403: ssl required
[255]
[100]
Checking cloned repo ids
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment