|
|
|
#!/usr/bin/python
|
|
|
|
# Copyright (c) 2009 The Chromium Authors. All rights reserved.
|
|
|
|
# Use of this source code is governed by a BSD-style license that can be
|
|
|
|
# found in the LICENSE file.
|
|
|
|
"""Wrapper for trychange.py for git checkout."""
|
|
|
|
|
|
|
|
import sys
|
|
|
|
|
|
|
|
try:
|
|
|
|
import breakpad
|
|
|
|
except ImportError:
|
|
|
|
pass
|
|
|
|
|
|
|
|
from scm import GIT
|
|
|
|
import trychange
|
|
|
|
|
|
|
|
|
|
|
|
def GetRietveldIssueNumber():
|
|
|
|
return GIT.Capture(
|
|
|
|
['config', 'branch.%s.rietveldissue' % GIT.GetBranch(None)],
|
|
|
|
error_ok=True)
|
|
|
|
|
|
|
|
|
|
|
|
def GetRietveldPatchsetNumber():
|
|
|
|
return GIT.Capture(
|
|
|
|
['config', 'branch.%s.rietveldpatchset' % GIT.GetBranch(None)],
|
|
|
|
error_ok=True)
|
|
|
|
|
|
|
|
|
|
|
|
if __name__ == '__main__':
|
|
|
|
args = sys.argv[:]
|
|
|
|
patchset = GetRietveldPatchsetNumber()
|
|
|
|
if patchset:
|
|
|
|
args.extend([
|
|
|
|
'--issue', GetRietveldIssueNumber(),
|
|
|
|
'--patchset', patchset,
|
|
|
|
])
|
|
|
|
sys.exit(trychange.TryChange(args, [], False, 'git-try'))
|