mirror of
https://github.com/mozilla/gecko-dev.git
synced 2024-11-29 07:42:04 +00:00
bug 1469284: allow ssh username to be passed to the merge day scripts. r=mtabara
This commit is contained in:
parent
beb57a9b08
commit
2d9f93eea7
@ -47,6 +47,13 @@ class GeckoMigration(MercurialScript, BalrogMixin, VirtualenvMixin,
|
||||
"default": "ffxbld <release@mozilla.com>",
|
||||
"help": "Specify what user to use to commit to hg.",
|
||||
}],
|
||||
[['--ssh-user', ], {
|
||||
"action": "store",
|
||||
"dest": "ssh_user",
|
||||
"type": "string",
|
||||
"default": None,
|
||||
"help": "The user to push to hg.mozilla.org as.",
|
||||
}],
|
||||
[['--balrog-api-root', ], {
|
||||
"action": "store",
|
||||
"dest": "balrog_api_root",
|
||||
@ -191,7 +198,12 @@ class GeckoMigration(MercurialScript, BalrogMixin, VirtualenvMixin,
|
||||
def set_push_to_ssh(self):
|
||||
for cwd in self.query_push_dirs():
|
||||
repo_url = self.read_repo_hg_rc(cwd).get('paths', 'default')
|
||||
push_dest = repo_url.replace('https://', 'ssh://')
|
||||
username = self.config.get('ssh_user', '')
|
||||
# Add a trailing @ to the username if it exists, otherwise it gets
|
||||
# mushed up with the hostname.
|
||||
if username:
|
||||
username += '@'
|
||||
push_dest = repo_url.replace('https://', 'ssh://' + username)
|
||||
|
||||
if not push_dest.startswith('ssh://'):
|
||||
raise Exception('Warning: path "{}" is not supported. Protocol must be ssh')
|
||||
|
Loading…
Reference in New Issue
Block a user