Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(480)

Unified Diff: git_try.py

Issue 188383002: Refactor the way that git executables are launched in depot tools. (Closed) Base URL: https://chromium.googlesource.com/chromium/tools/depot_tools.git@master
Patch Set: Created 6 years, 10 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: git_try.py
diff --git a/git_try.py b/git_try.py
deleted file mode 100755
index 45a5217e6f2a5fdd665af049c7f57b867ca98228..0000000000000000000000000000000000000000
--- a/git_try.py
+++ /dev/null
@@ -1,70 +0,0 @@
-#!/usr/bin/python
-# Copyright (c) 2011 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 logging
-import sys
-
-import breakpad # pylint: disable=W0611
-
-from scm import GIT
-import subprocess2
-import third_party.upload
-import trychange
-import git_cl
-
-
-def GetRietveldIssueNumber():
- try:
- return GIT.Capture(
- ['config', 'branch.%s.rietveldissue' % GIT.GetBranch('.')],
- '.').strip()
- except subprocess2.CalledProcessError:
- return None
-
-
-def GetRietveldPatchsetNumber():
- try:
- return GIT.Capture(
- ['config', 'branch.%s.rietveldpatchset' % GIT.GetBranch('.')],
- '.').strip()
- except subprocess2.CalledProcessError:
- return None
-
-
-def GetRietveldServerUrl():
- try:
- return GIT.Capture(['config', 'rietveld.server'], '.').strip()
- except subprocess2.CalledProcessError:
- return None
-
-
-if __name__ == '__main__':
- args = sys.argv[1:]
- patchset = GetRietveldPatchsetNumber()
- if patchset:
- args.extend([
- '--issue', GetRietveldIssueNumber(),
- '--patchset', patchset,
- ])
- else:
- rietveld_url = GetRietveldServerUrl()
- if rietveld_url:
- args.extend(['--rietveld_url', GetRietveldServerUrl()])
- try:
- cl = git_cl.Changelist()
- change = cl.GetChange(cl.GetUpstreamBranch(), None)
- # Hack around a limitation in logging.
- logging.getLogger().handlers = []
- sys.exit(trychange.TryChange(
- args, change, swallow_exception=False,
- prog='git try',
- extra_epilog='\n'
- 'git try will diff against your tracked branch and will '
- 'detect your rietveld\n'
- 'code review if you are using git-cl\n'))
- except third_party.upload.ClientLoginError, e:
- print('Got an exception while trying to log in to Rietveld.')
- print(str(e))

Powered by Google App Engine
This is Rietveld 408576698