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

Side by Side Diff: git_cl.py

Issue 269483002: Get presubmit_support to compute diffs against a given upstream. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/tools/depot_tools
Patch Set: Created 6 years, 7 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 | « no previous file | presubmit_support.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 (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 777 matching lines...) Expand 10 before | Expand all | Expand 10 after
788 788
789 if not author: 789 if not author:
790 author = RunGit(['config', 'user.email']).strip() or None 790 author = RunGit(['config', 'user.email']).strip() or None
791 return presubmit_support.GitChange( 791 return presubmit_support.GitChange(
792 name, 792 name,
793 description, 793 description,
794 absroot, 794 absroot,
795 files, 795 files,
796 issue, 796 issue,
797 patchset, 797 patchset,
798 author) 798 author,
799 upstream=upstream_branch)
799 800
800 def RunHook(self, committing, may_prompt, verbose, change): 801 def RunHook(self, committing, may_prompt, verbose, change):
801 """Calls sys.exit() if the hook fails; returns a HookResults otherwise.""" 802 """Calls sys.exit() if the hook fails; returns a HookResults otherwise."""
802 803
803 try: 804 try:
804 return presubmit_support.DoPresubmitChecks(change, committing, 805 return presubmit_support.DoPresubmitChecks(change, committing,
805 verbose=verbose, output_stream=sys.stdout, input_stream=sys.stdin, 806 verbose=verbose, output_stream=sys.stdout, input_stream=sys.stdin,
806 default_presubmit=None, may_prompt=may_prompt, 807 default_presubmit=None, may_prompt=may_prompt,
807 rietveld_obj=self.RpcServer()) 808 rietveld_obj=self.RpcServer())
808 except presubmit_support.PresubmitFailure, e: 809 except presubmit_support.PresubmitFailure, e:
(...skipping 1757 matching lines...) Expand 10 before | Expand all | Expand 10 after
2566 ('AppEngine is misbehaving and returned HTTP %d, again. Keep faith ' 2567 ('AppEngine is misbehaving and returned HTTP %d, again. Keep faith '
2567 'and retry or visit go/isgaeup.\n%s') % (e.code, str(e))) 2568 'and retry or visit go/isgaeup.\n%s') % (e.code, str(e)))
2568 2569
2569 2570
2570 if __name__ == '__main__': 2571 if __name__ == '__main__':
2571 # These affect sys.stdout so do it outside of main() to simplify mocks in 2572 # These affect sys.stdout so do it outside of main() to simplify mocks in
2572 # unit testing. 2573 # unit testing.
2573 fix_encoding.fix_encoding() 2574 fix_encoding.fix_encoding()
2574 colorama.init() 2575 colorama.init()
2575 sys.exit(main(sys.argv[1:])) 2576 sys.exit(main(sys.argv[1:]))
OLDNEW
« no previous file with comments | « no previous file | presubmit_support.py » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698