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

Side by Side Diff: git_cl.py

Issue 731473002: Improved git cl patch generated commit message to include patchset information (Closed) Base URL: https://chromium.googlesource.com/chromium/tools/depot_tools.git@master
Patch Set: Just a nit. Created 6 years, 1 month 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 2352 matching lines...) Expand 10 before | Expand all | Expand 10 after
2363 elif IsGitVersionAtLeast('1.7.12'): 2363 elif IsGitVersionAtLeast('1.7.12'):
2364 cmd.append('--3way') 2364 cmd.append('--3way')
2365 try: 2365 try:
2366 subprocess2.check_call(cmd, env=GetNoGitPagerEnv(), 2366 subprocess2.check_call(cmd, env=GetNoGitPagerEnv(),
2367 stdin=patch_data, stdout=subprocess2.VOID) 2367 stdin=patch_data, stdout=subprocess2.VOID)
2368 except subprocess2.CalledProcessError: 2368 except subprocess2.CalledProcessError:
2369 DieWithError('Failed to apply the patch') 2369 DieWithError('Failed to apply the patch')
2370 2370
2371 # If we had an issue, commit the current state and register the issue. 2371 # If we had an issue, commit the current state and register the issue.
2372 if not nocommit: 2372 if not nocommit:
2373 RunGit(['commit', '-m', 'patch from issue %s' % issue]) 2373 RunGit(['commit', '-m', ('patch from issue %(i)s at patchset '
2374 '%(p)s (http://crrev.com/%(i)s#ps%(p)s)'
2375 % {'i': issue, 'p': patchset})])
2374 cl = Changelist() 2376 cl = Changelist()
2375 cl.SetIssue(issue) 2377 cl.SetIssue(issue)
2376 cl.SetPatchset(patchset) 2378 cl.SetPatchset(patchset)
2377 print "Committed patch locally." 2379 print "Committed patch locally."
2378 else: 2380 else:
2379 print "Patch applied to index." 2381 print "Patch applied to index."
2380 return 0 2382 return 0
2381 2383
2382 2384
2383 def CMDrebase(parser, args): 2385 def CMDrebase(parser, args):
(...skipping 503 matching lines...) Expand 10 before | Expand all | Expand 10 after
2887 ('AppEngine is misbehaving and returned HTTP %d, again. Keep faith ' 2889 ('AppEngine is misbehaving and returned HTTP %d, again. Keep faith '
2888 'and retry or visit go/isgaeup.\n%s') % (e.code, str(e))) 2890 'and retry or visit go/isgaeup.\n%s') % (e.code, str(e)))
2889 2891
2890 2892
2891 if __name__ == '__main__': 2893 if __name__ == '__main__':
2892 # These affect sys.stdout so do it outside of main() to simplify mocks in 2894 # These affect sys.stdout so do it outside of main() to simplify mocks in
2893 # unit testing. 2895 # unit testing.
2894 fix_encoding.fix_encoding() 2896 fix_encoding.fix_encoding()
2895 colorama.init() 2897 colorama.init()
2896 sys.exit(main(sys.argv[1:])) 2898 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