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

Side by Side Diff: git_cl.py

Issue 889093002: Allow branch name to be the same as directory name for "git cl diff" (Closed) Base URL: https://chromium.googlesource.com/chromium/tools/depot_tools.git@master
Patch Set: revert "follow coding convention of the file" Created 5 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 unified diff | Download patch
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 #!/usr/bin/env python 1 #!/usr/bin/env python
2 # Copyright (c) 2012 The Chromium Authors. All rights reserved. 2 # Copyright (c) 2012 The Chromium Authors. All rights reserved.
3 # Use of this source code is governed by a BSD-style license that can be 3 # Use of this source code is governed by a BSD-style license that can be
4 # found in the LICENSE file. 4 # found in the LICENSE file.
5 5
6 # Copyright (C) 2008 Evan Martin <martine@danga.com> 6 # Copyright (C) 2008 Evan Martin <martine@danga.com>
7 7
8 """A git-command for integrating reviews on Rietveld.""" 8 """A git-command for integrating reviews on Rietveld."""
9 9
10 from distutils.version import LooseVersion 10 from distutils.version import LooseVersion
(...skipping 2767 matching lines...) Expand 10 before | Expand all | Expand 10 after
2778 base_branch = cl.GetCommonAncestorWithUpstream() 2778 base_branch = cl.GetCommonAncestorWithUpstream()
2779 2779
2780 # Create a new branch based on the merge-base 2780 # Create a new branch based on the merge-base
2781 RunGit(['checkout', '-q', '-b', TMP_BRANCH, base_branch]) 2781 RunGit(['checkout', '-q', '-b', TMP_BRANCH, base_branch])
2782 try: 2782 try:
2783 # Patch in the latest changes from rietveld. 2783 # Patch in the latest changes from rietveld.
2784 rtn = PatchIssue(issue, False, False, None) 2784 rtn = PatchIssue(issue, False, False, None)
2785 if rtn != 0: 2785 if rtn != 0:
2786 return rtn 2786 return rtn
2787 2787
2788 # Switch back to starting brand and diff against the temporary 2788 # Switch back to starting branch and diff against the temporary
2789 # branch containing the latest rietveld patch. 2789 # branch containing the latest rietveld patch.
2790 subprocess2.check_call(['git', 'diff', TMP_BRANCH, branch]) 2790 subprocess2.check_call(['git', 'diff', TMP_BRANCH, branch, '--'])
2791 finally: 2791 finally:
2792 RunGit(['checkout', '-q', branch]) 2792 RunGit(['checkout', '-q', branch])
2793 RunGit(['branch', '-D', TMP_BRANCH]) 2793 RunGit(['branch', '-D', TMP_BRANCH])
2794 2794
2795 return 0 2795 return 0
2796 2796
2797 2797
2798 def CMDowners(parser, args): 2798 def CMDowners(parser, args):
2799 """interactively find the owners for reviewing""" 2799 """interactively find the owners for reviewing"""
2800 parser.add_option( 2800 parser.add_option(
(...skipping 173 matching lines...) Expand 10 before | Expand all | Expand 10 after
2974 ('AppEngine is misbehaving and returned HTTP %d, again. Keep faith ' 2974 ('AppEngine is misbehaving and returned HTTP %d, again. Keep faith '
2975 'and retry or visit go/isgaeup.\n%s') % (e.code, str(e))) 2975 'and retry or visit go/isgaeup.\n%s') % (e.code, str(e)))
2976 2976
2977 2977
2978 if __name__ == '__main__': 2978 if __name__ == '__main__':
2979 # These affect sys.stdout so do it outside of main() to simplify mocks in 2979 # These affect sys.stdout so do it outside of main() to simplify mocks in
2980 # unit testing. 2980 # unit testing.
2981 fix_encoding.fix_encoding() 2981 fix_encoding.fix_encoding()
2982 colorama.init() 2982 colorama.init()
2983 sys.exit(main(sys.argv[1:])) 2983 sys.exit(main(sys.argv[1:]))
OLDNEW
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698