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

Side by Side Diff: tools/svn.py

Issue 25447003: Make svndiff.py work on Windows and with svn 1.7. (Closed) Base URL: http://skia.googlecode.com/svn/trunk/
Patch Set: Created 7 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 | Annotate | Revision Log
« no previous file with comments | « no previous file | tools/svndiff.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 ''' 1 '''
2 Copyright 2011 Google Inc. 2 Copyright 2011 Google Inc.
3 3
4 Use of this source code is governed by a BSD-style license that can be 4 Use of this source code is governed by a BSD-style license that can be
5 found in the LICENSE file. 5 found in the LICENSE file.
6 ''' 6 '''
7 7
8 import fnmatch 8 import fnmatch
9 import os 9 import os
10 import re 10 import re
(...skipping 117 matching lines...) Expand 10 before | Expand all | Expand 10 after
128 status_types_string = '' 128 status_types_string = ''
129 if status & STATUS_ADDED: 129 if status & STATUS_ADDED:
130 status_types_string += 'A' 130 status_types_string += 'A'
131 if status & STATUS_DELETED: 131 if status & STATUS_DELETED:
132 status_types_string += 'D' 132 status_types_string += 'D'
133 if status & STATUS_MODIFIED: 133 if status & STATUS_MODIFIED:
134 status_types_string += 'M' 134 status_types_string += 'M'
135 if status & STATUS_NOT_UNDER_SVN_CONTROL: 135 if status & STATUS_NOT_UNDER_SVN_CONTROL:
136 status_types_string += '\?' 136 status_types_string += '\?'
137 status_regex_string = '^[%s].....\s+(.+)$' % status_types_string 137 status_regex_string = '^[%s].....\s+(.+)$' % status_types_string
138 stdout = self._RunCommand([SVN, 'status']) 138 stdout = self._RunCommand([SVN, 'status']).replace('\r', '')
139 status_regex = re.compile(status_regex_string, re.MULTILINE) 139 status_regex = re.compile(status_regex_string, re.MULTILINE)
140 files = status_regex.findall(stdout) 140 files = status_regex.findall(stdout)
141 return files 141 return files
142 142
143 def AddFiles(self, filenames): 143 def AddFiles(self, filenames):
144 """Adds these files to SVN control. 144 """Adds these files to SVN control.
145 145
146 @param filenames files to add to SVN control 146 @param filenames files to add to SVN control
147 """ 147 """
148 self._RunCommand([SVN, 'add'] + filenames) 148 self._RunCommand([SVN, 'add'] + filenames)
(...skipping 23 matching lines...) Expand all
172 self.SetProperty(matching_files, property_name, property_value) 172 self.SetProperty(matching_files, property_name, property_value)
173 173
174 def ExportBaseVersionOfFile(self, file_within_repo, dest_path): 174 def ExportBaseVersionOfFile(self, file_within_repo, dest_path):
175 """Retrieves a copy of the base version (what you would get if you ran 175 """Retrieves a copy of the base version (what you would get if you ran
176 'svn revert') of a file within the repository. 176 'svn revert') of a file within the repository.
177 177
178 @param file_within_repo path to the file within the repo whose base 178 @param file_within_repo path to the file within the repo whose base
179 version you wish to obtain 179 version you wish to obtain
180 @param dest_path destination to which to write the base content 180 @param dest_path destination to which to write the base content
181 """ 181 """
182 self._RunCommand([SVN, 'export', '--revision', 'BASE', 182 self._RunCommand([SVN, 'export', '--revision', 'BASE', '--force',
183 file_within_repo, dest_path]) 183 file_within_repo, dest_path])
OLDNEW
« no previous file with comments | « no previous file | tools/svndiff.py » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698