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

Side by Side Diff: git_upstream_diff.py

Issue 2075603002: Refactor git_common config and die (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/tools/depot_tools
Patch Set: Fix unintended change Created 4 years, 6 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 | Annotate | Revision Log
« no previous file with comments | « git_rebase_update.py ('k') | tests/git_common_test.py » ('j') | 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 2014 The Chromium Authors. All rights reserved. 2 # Copyright 2014 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 import argparse 6 import argparse
7 import sys 7 import sys
8 8
9 import subprocess2 9 import subprocess2
10 10
11 import git_common as git 11 import git_common as git
12 12
13 def main(args): 13 def main(args):
14 default_args = git.config_list('depot-tools.upstream-diff.default-args') 14 default_args = git.get_config_list('depot-tools.upstream-diff.default-args')
15 args = default_args + args 15 args = default_args + args
16 16
17 parser = argparse.ArgumentParser() 17 parser = argparse.ArgumentParser()
18 parser.add_argument('--wordwise', action='store_true', default=False, 18 parser.add_argument('--wordwise', action='store_true', default=False,
19 help=( 19 help=(
20 'Print a colorized wordwise diff ' 20 'Print a colorized wordwise diff '
21 'instead of line-wise diff')) 21 'instead of line-wise diff'))
22 opts, extra_args = parser.parse_known_args(args) 22 opts, extra_args = parser.parse_known_args(args)
23 23
24 cur = git.current_branch() 24 cur = git.current_branch()
(...skipping 15 matching lines...) Expand all
40 40
41 return subprocess2.check_call(cmd) 41 return subprocess2.check_call(cmd)
42 42
43 43
44 if __name__ == '__main__': 44 if __name__ == '__main__':
45 try: 45 try:
46 sys.exit(main(sys.argv[1:])) 46 sys.exit(main(sys.argv[1:]))
47 except KeyboardInterrupt: 47 except KeyboardInterrupt:
48 sys.stderr.write('interrupted\n') 48 sys.stderr.write('interrupted\n')
49 sys.exit(1) 49 sys.exit(1)
OLDNEW
« no previous file with comments | « git_rebase_update.py ('k') | tests/git_common_test.py » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698