| 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 67 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 78 def Checkout(self, url, path): | 78 def Checkout(self, url, path): |
| 79 """Check out a working copy from a repository. | 79 """Check out a working copy from a repository. |
| 80 Returns stdout as a single string. | 80 Returns stdout as a single string. |
| 81 | 81 |
| 82 @param url URL from which to check out the working copy | 82 @param url URL from which to check out the working copy |
| 83 @param path path (within self._directory) where the local copy will be | 83 @param path path (within self._directory) where the local copy will be |
| 84 written | 84 written |
| 85 """ | 85 """ |
| 86 return self._RunCommand([SVN, 'checkout', url, path]) | 86 return self._RunCommand([SVN, 'checkout', url, path]) |
| 87 | 87 |
| 88 def Update(self, path): |
| 89 """Update the working copy. |
| 90 Returns stdout as a single string. |
| 91 |
| 92 @param path path (within self._directory) within which to run |
| 93 "svn update" |
| 94 """ |
| 95 return self._RunCommand([SVN, 'update', path]) |
| 96 |
| 88 def ListSubdirs(self, url): | 97 def ListSubdirs(self, url): |
| 89 """Returns a list of all subdirectories (not files) within a given SVN | 98 """Returns a list of all subdirectories (not files) within a given SVN |
| 90 url. | 99 url. |
| 91 | 100 |
| 92 @param url remote directory to list subdirectories of | 101 @param url remote directory to list subdirectories of |
| 93 """ | 102 """ |
| 94 subdirs = [] | 103 subdirs = [] |
| 95 filenames = self._RunCommand([SVN, 'ls', url]).split('\n') | 104 filenames = self._RunCommand([SVN, 'ls', url]).split('\n') |
| 96 for filename in filenames: | 105 for filename in filenames: |
| 97 if filename.endswith('/'): | 106 if filename.endswith('/'): |
| (...skipping 67 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 165 def ExportBaseVersionOfFile(self, file_within_repo, dest_path): | 174 def ExportBaseVersionOfFile(self, file_within_repo, dest_path): |
| 166 """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 |
| 167 'svn revert') of a file within the repository. | 176 'svn revert') of a file within the repository. |
| 168 | 177 |
| 169 @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 |
| 170 version you wish to obtain | 179 version you wish to obtain |
| 171 @param dest_path destination to which to write the base content | 180 @param dest_path destination to which to write the base content |
| 172 """ | 181 """ |
| 173 self._RunCommand([SVN, 'export', '--revision', 'BASE', | 182 self._RunCommand([SVN, 'export', '--revision', 'BASE', |
| 174 file_within_repo, dest_path]) | 183 file_within_repo, dest_path]) |
| OLD | NEW |