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

Side by Side Diff: rietveld.py

Issue 10375056: Moving a file in the same directory result in status 'R'. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/tools/depot_tools
Patch Set: Created 8 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 | 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 # coding: utf-8 1 # coding: utf-8
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 """Defines class Rietveld to easily access a rietveld instance. 5 """Defines class Rietveld to easily access a rietveld instance.
6 6
7 Security implications: 7 Security implications:
8 8
9 The following hypothesis are made: 9 The following hypothesis are made:
10 - Rietveld enforces: 10 - Rietveld enforces:
(...skipping 95 matching lines...) Expand 10 before | Expand all | Expand 10 after
106 106
107 def get_patch(self, issue, patchset): 107 def get_patch(self, issue, patchset):
108 """Returns a PatchSet object containing the details to apply this patch.""" 108 """Returns a PatchSet object containing the details to apply this patch."""
109 props = self.get_patchset_properties(issue, patchset) or {} 109 props = self.get_patchset_properties(issue, patchset) or {}
110 out = [] 110 out = []
111 for filename, state in props.get('files', {}).iteritems(): 111 for filename, state in props.get('files', {}).iteritems():
112 logging.debug('%s' % filename) 112 logging.debug('%s' % filename)
113 # If not status, just assume it's a 'M'. Rietveld often gets it wrong and 113 # If not status, just assume it's a 'M'. Rietveld often gets it wrong and
114 # just has status: null. Oh well. 114 # just has status: null. Oh well.
115 status = state.get('status') or 'M' 115 status = state.get('status') or 'M'
116 if status[0] not in ('A', 'D', 'M'): 116 if status[0] not in ('A', 'D', 'M', 'R'):
117 raise patch.UnsupportedPatchFormat( 117 raise patch.UnsupportedPatchFormat(
118 filename, 'Change with status \'%s\' is not supported.' % status) 118 filename, 'Change with status \'%s\' is not supported.' % status)
119 119
120 svn_props = self.parse_svn_properties( 120 svn_props = self.parse_svn_properties(
121 state.get('property_changes', ''), filename) 121 state.get('property_changes', ''), filename)
122 122
123 if state.get('is_binary'): 123 if state.get('is_binary'):
124 if status[0] == 'D': 124 if status[0] == 'D':
125 if status[0] != status.strip(): 125 if status[0] != status.strip():
126 raise patch.UnsupportedPatchFormat( 126 raise patch.UnsupportedPatchFormat(
(...skipping 209 matching lines...) Expand 10 before | Expand all | Expand 10 after
336 if not 'Name or service not known' in e.reason: 336 if not 'Name or service not known' in e.reason:
337 # Usually internal GAE flakiness. 337 # Usually internal GAE flakiness.
338 raise 338 raise
339 # If reaching this line, loop again. Uses a small backoff. 339 # If reaching this line, loop again. Uses a small backoff.
340 time.sleep(1+maxtries*2) 340 time.sleep(1+maxtries*2)
341 finally: 341 finally:
342 upload.ErrorExit = old_error_exit 342 upload.ErrorExit = old_error_exit
343 343
344 # DEPRECATED. 344 # DEPRECATED.
345 Send = get 345 Send = get
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