Bug 1554987 - Invoke git push with a remote name for mach try. r=ahal

The git version shipped in some versions of OSX is patched by apple in a
way such that doing `git push hg::ssh://...` fails with an error message
like `Invalid remote name "hg::ssh://...`.

So instead, we define a named remote via inline configuration, and use
that remote's name for the push.

Differential Revision: https://phabricator.services.mozilla.com/D35351

--HG--
extra : moz-landing-system : lando
This commit is contained in:
Mike Hommey 2019-06-24 14:40:21 +00:00
parent 1700203426
commit e5d8e3b235

View File

@ -456,7 +456,11 @@ class GitRepository(Repository):
self._run('commit', '--allow-empty', '-m', message)
try:
subprocess.check_call((self._tool, 'push', 'hg::ssh://hg.mozilla.org/try',
subprocess.check_call((self._tool,
'-c',
'remote.try.url=hg::ssh://hg.mozilla.org/try',
'push',
'try',
'+HEAD:refs/heads/branches/default/tip'), cwd=self.path)
finally:
self._run('reset', 'HEAD~')