diff --git a/mercurial/scmutil.py b/mercurial/scmutil.py --- a/mercurial/scmutil.py +++ b/mercurial/scmutil.py @@ -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): diff --git a/tests/test-bad-pull.t b/tests/test-bad-pull.t --- a/tests/test-bad-pull.t +++ b/tests/test-bad-pull.t @@ -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 diff --git a/tests/test-bundle2-exchange.t b/tests/test-bundle2-exchange.t --- a/tests/test-bundle2-exchange.t +++ b/tests/test-bundle2-exchange.t @@ -987,7 +987,7 @@ Servers can disable bundle1 for clone/pu 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 general 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 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 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) diff --git a/tests/test-clone.t b/tests/test-clone.t --- a/tests/test-clone.t +++ b/tests/test-clone.t @@ -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 diff --git a/tests/test-extdata.t b/tests/test-extdata.t --- a/tests/test-extdata.t +++ b/tests/test-extdata.t @@ -113,7 +113,7 @@ we don't fix up relative file URLs, but $ cd sub $ hg log -qr "extdata(filedata)" abort: error: $ENOENT$ - [255] + [100] $ hg log -qr "extdata(shelldata)" 2:f6ed99a58333 diff --git a/tests/test-http-bad-server.t b/tests/test-http-bad-server.t --- a/tests/test-http-bad-server.t +++ b/tests/test-http-bad-server.t @@ -41,7 +41,7 @@ Failure to accept() socket should result $ 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 observa --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 HTT $ 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 $ 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 th $ 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 ar $ 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 $ hg clone http://localhost:$HGPORT/ clone abort: error: bad HTTP status line: H - [255] + [100] $ killdaemons.py $DAEMON_PIDS diff --git a/tests/test-http-bundle1.t b/tests/test-http-bundle1.t --- a/tests/test-http-bundle1.t +++ b/tests/test-http-bundle1.t @@ -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 uns 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 uns 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/clon 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 diff --git a/tests/test-http-permissions.t b/tests/test-http-permissions.t --- a/tests/test-http-permissions.t +++ b/tests/test-http-permissions.t @@ -874,13 +874,13 @@ Reset server to remove REQUEST_METHOD ha 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 diff --git a/tests/test-http-proxy.t b/tests/test-http-proxy.t --- a/tests/test-http-proxy.t +++ b/tests/test-http-proxy.t @@ -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 diff --git a/tests/test-http.t b/tests/test-http.t --- a/tests/test-http.t +++ b/tests/test-http.t @@ -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 uns 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 uns 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 $ 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 dom $ 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 a $ hg --config auth.cookiefile=cookies.txt id http://localhost:$HGPORT/ abort: HTTP Error 500: Cookie: hgkey=localhostvalue - [255] + [100] diff --git a/tests/test-https.t b/tests/test-https.t --- a/tests/test-https.t +++ b/tests/test-https.t @@ -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 s (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 vali 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 (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 wor (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 wor (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 pr 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 diff --git a/tests/test-largefiles-wireproto.t b/tests/test-largefiles-wireproto.t --- a/tests/test-largefiles-wireproto.t +++ b/tests/test-largefiles-wireproto.t @@ -117,7 +117,7 @@ exit code with nothing outgoing (issue36 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 largefil remote: - abort: remote error (check previous remote output) - [255] + [100] #if serve diff --git a/tests/test-push-http.t b/tests/test-push-http.t --- a/tests/test-push-http.t +++ b/tests/test-push-http.t @@ -41,7 +41,7 @@ expect ssl error searching for changes abort: HTTP Error 403: ssl required % serve errors - [255] + [100] expect authorization error diff --git a/tests/test-serve.t b/tests/test-serve.t --- a/tests/test-serve.t +++ b/tests/test-serve.t @@ -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) diff --git a/tests/test-static-http.t b/tests/test-static-http.t --- a/tests/test-static-http.t +++ b/tests/test-static-http.t @@ -2,7 +2,7 @@ $ hg clone http://localhost:$HGPORT/ copy abort: * (glob) - [255] + [100] $ test -d copy [1] diff --git a/tests/test-subrepo-deep-nested-change.t b/tests/test-subrepo-deep-nested-change.t --- a/tests/test-subrepo-deep-nested-change.t +++ b/tests/test-subrepo-deep-nested-change.t @@ -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) diff --git a/tests/test-subrepo-relative-path.t b/tests/test-subrepo-relative-path.t --- a/tests/test-subrepo-relative-path.t +++ b/tests/test-subrepo-relative-path.t @@ -85,7 +85,7 @@ just masked out, and that would make the searching for changes no changes found abort: HTTP Error 403: ssl required - [255] + [100] Checking cloned repo ids