From e3144ea35900f9a1183327f07b82918d2ba9f3fa Mon Sep 17 00:00:00 2001 From: agable Date: Tue, 26 Jul 2016 16:07:55 -0700 Subject: [PATCH] Remove git-try from depot_tools R=mmoss@chromium.org BUG=609893 Review-Url: https://codereview.chromium.org/2188493004 --- git-try | 9 ------- git_try.py | 76 ------------------------------------------------------ 2 files changed, 85 deletions(-) delete mode 100755 git-try delete mode 100755 git_try.py diff --git a/git-try b/git-try deleted file mode 100755 index f847754af1..0000000000 --- a/git-try +++ /dev/null @@ -1,9 +0,0 @@ -#!/usr/bin/env bash -# 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. - -# git_try.py - Commits a patch to the SVN try patch repo. -# It is highly recommended to use `git cl try` instead. - -. $(type -P python_runner.sh) diff --git a/git_try.py b/git_try.py deleted file mode 100755 index e0fb7f6d6a..0000000000 --- a/git_try.py +++ /dev/null @@ -1,76 +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 - -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 - - -def main(args): - 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)) - return 0 - - -if __name__ == '__main__': - try: - sys.exit(main(sys.argv[1:])) - except KeyboardInterrupt: - sys.stderr.write('interrupted\n') - sys.exit(1)