Patchwork D3446: dispatch: move sys.exit() to caller (API)

login
register
mail settings
Submitter phabricator
Date May 12, 2018, 4:48 a.m.
Message ID <216ff0d8d162b3c96dbb7dfa27fb3e94@localhost.localdomain>
Download mbox | patch
Permalink /patch/31545/
State Not Applicable
Headers show

Comments

phabricator - May 12, 2018, 4:48 a.m.
indygreg updated this revision to Diff 8655.

REPOSITORY
  rHG Mercurial

CHANGES SINCE LAST UPDATE
  https://phab.mercurial-scm.org/D3446?vs=8461&id=8655

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

AFFECTED FILES
  contrib/hgperf
  hg
  mercurial/dispatch.py

CHANGE DETAILS




To: indygreg, #hg-reviewers, lothiraldan
Cc: mercurial-devel

Patch

diff --git a/mercurial/dispatch.py b/mercurial/dispatch.py
--- a/mercurial/dispatch.py
+++ b/mercurial/dispatch.py
@@ -126,7 +126,7 @@ 
             status = -1
 
     _silencestdio()
-    sys.exit(status & 255)
+    return status & 255
 
 if pycompat.ispy3:
     def initstdio():
diff --git a/hg b/hg
--- a/hg
+++ b/hg
@@ -38,4 +38,4 @@ 
     sys.exit(-1)
 
 from mercurial import dispatch
-dispatch.run()
+sys.exit(dispatch.run())
diff --git a/contrib/hgperf b/contrib/hgperf
--- a/contrib/hgperf
+++ b/contrib/hgperf
@@ -94,4 +94,4 @@ 
 
 dispatch.runcommand = runcommand
 
-dispatch.run()
+sys.exit(dispatch.run())