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

Side by Side Diff: trychange.py

Issue 11046004: Added extra error message to trychange for empty diffs (Closed) Base URL: https://git.chromium.org/chromium/tools/depot_tools.git@master
Patch Set: Created 8 years, 2 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 """Client-side script to send a try job to the try server. It communicates to 6 """Client-side script to send a try job to the try server. It communicates to
7 the try server by either writting to a svn repository or by directly connecting 7 the try server by either writting to a svn repository or by directly connecting
8 to the server by HTTP. 8 to the server by HTTP.
9 """ 9 """
10 10
(...skipping 759 matching lines...) Expand 10 before | Expand all | Expand 10 after
770 diff = GetMungedDiff('', urllib.urlopen(diff_url).readlines()) 770 diff = GetMungedDiff('', urllib.urlopen(diff_url).readlines())
771 options.diff = ''.join(diff[0]) 771 options.diff = ''.join(diff[0])
772 changed_files = diff[1] 772 changed_files = diff[1]
773 else: 773 else:
774 # Use this as the base. 774 # Use this as the base.
775 root = checkouts[0].checkout_root 775 root = checkouts[0].checkout_root
776 diffs = [] 776 diffs = []
777 for checkout in checkouts: 777 for checkout in checkouts:
778 raw_diff = checkout.GenerateDiff() 778 raw_diff = checkout.GenerateDiff()
779 if not raw_diff: 779 if not raw_diff:
780 logging.error('Empty or non-existant diff, exiting.')
780 return 1 781 return 1
781 diff = raw_diff.splitlines(True) 782 diff = raw_diff.splitlines(True)
782 path_diff = gclient_utils.PathDifference(root, checkout.checkout_root) 783 path_diff = gclient_utils.PathDifference(root, checkout.checkout_root)
783 # Munge it. 784 # Munge it.
784 diffs.extend(GetMungedDiff(path_diff, diff)[0]) 785 diffs.extend(GetMungedDiff(path_diff, diff)[0])
785 options.diff = ''.join(diffs) 786 options.diff = ''.join(diffs)
786 787
787 if not options.name: 788 if not options.name:
788 if options.issue: 789 if options.issue:
789 options.name = 'Issue %s' % options.issue 790 options.name = 'Issue %s' % options.issue
(...skipping 83 matching lines...) Expand 10 before | Expand all | Expand 10 after
873 return 1 874 return 1
874 except (gclient_utils.Error, subprocess2.CalledProcessError), e: 875 except (gclient_utils.Error, subprocess2.CalledProcessError), e:
875 print >> sys.stderr, e 876 print >> sys.stderr, e
876 return 1 877 return 1
877 return 0 878 return 0
878 879
879 880
880 if __name__ == "__main__": 881 if __name__ == "__main__":
881 fix_encoding.fix_encoding() 882 fix_encoding.fix_encoding()
882 sys.exit(TryChange(None, None, False)) 883 sys.exit(TryChange(None, None, False))
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