OLD | NEW |
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 Loading... |
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 Loading... |
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]) |
OLD | NEW |