comparison contrib/automation/hgautomation/windows.py @ 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 862f6bddacce
children 9e0f1c80cddb
comparison
equal deleted inserted replaced
42659:701341f57ceb 42660:24cd5b0ba5b3
178 '--config', 'ui.remotecmd=c:/hgdev/venv-bootstrap/Scripts/hg.exe', 178 '--config', 'ui.remotecmd=c:/hgdev/venv-bootstrap/Scripts/hg.exe',
179 'push', '-f', '-r', full_revision, 179 'push', '-f', '-r', full_revision,
180 'ssh://%s/c:/hgdev/src' % public_ip, 180 'ssh://%s/c:/hgdev/src' % public_ip,
181 ] 181 ]
182 182
183 subprocess.run(args, cwd=str(hg_repo), env=env, check=True) 183 res = subprocess.run(args, cwd=str(hg_repo), env=env)
184
185 # Allow 1 (no-op) to not trigger error.
186 if res.returncode not in (0, 1):
187 res.check_returncode()
184 188
185 run_powershell(winrm_client, 189 run_powershell(winrm_client,
186 HG_UPDATE_CLEAN.format(revision=full_revision)) 190 HG_UPDATE_CLEAN.format(revision=full_revision))
187 191
188 # TODO detect dirty local working directory and synchronize accordingly. 192 # TODO detect dirty local working directory and synchronize accordingly.