changeset 42660:24cd5b0ba5b3 stable

automation: allow exit code of 1 for `hg push` `hg push` exits 1 for no-ops. No-op pushes should be fine in the context of automation.
author Gregory Szorc <gregory.szorc@gmail.com>
date Sun, 28 Jul 2019 18:16:08 -0700
parents 701341f57ceb
children e91930d712e8
files contrib/automation/hgautomation/linux.py contrib/automation/hgautomation/windows.py
diffstat 2 files changed, 10 insertions(+), 2 deletions(-) [+]
line wrap: on
line diff
--- a/contrib/automation/hgautomation/linux.py	Thu Jul 25 21:28:29 2019 +0900
+++ b/contrib/automation/hgautomation/linux.py	Sun Jul 28 18:16:08 2019 -0700
@@ -489,7 +489,11 @@
             'ssh://%s//hgwork/src' % public_ip,
         ]
 
-        subprocess.run(args, cwd=str(source_path), env=env, check=True)
+        res = subprocess.run(args, cwd=str(source_path), env=env)
+
+        # Allow 1 (no-op) to not trigger error.
+        if res.returncode not in (0, 1):
+            res.check_returncode()
 
         # TODO support synchronizing dirty working directory.
 
--- a/contrib/automation/hgautomation/windows.py	Thu Jul 25 21:28:29 2019 +0900
+++ b/contrib/automation/hgautomation/windows.py	Sun Jul 28 18:16:08 2019 -0700
@@ -180,7 +180,11 @@
             'ssh://%s/c:/hgdev/src' % public_ip,
         ]
 
-        subprocess.run(args, cwd=str(hg_repo), env=env, check=True)
+        res = subprocess.run(args, cwd=str(hg_repo), env=env)
+
+        # Allow 1 (no-op) to not trigger error.
+        if res.returncode not in (0, 1):
+            res.check_returncode()
 
         run_powershell(winrm_client,
                        HG_UPDATE_CLEAN.format(revision=full_revision))