|
|
|
|
@ -740,7 +740,8 @@ class SVNWrapper(SCMWrapper):
|
|
|
|
|
if not os.path.exists(checkout_path):
|
|
|
|
|
# We need to checkout.
|
|
|
|
|
command = ['checkout', url, checkout_path]
|
|
|
|
|
command = self.AddAdditionalFlags(command, options, revision)
|
|
|
|
|
if revision:
|
|
|
|
|
command.extend(['--revision', str(revision).strip()])
|
|
|
|
|
scm.SVN.RunAndGetFileList(options, command, self._root_dir, file_list)
|
|
|
|
|
return
|
|
|
|
|
|
|
|
|
|
@ -797,7 +798,8 @@ class SVNWrapper(SCMWrapper):
|
|
|
|
|
gclient_utils.RemoveDirectory(checkout_path)
|
|
|
|
|
# We need to checkout.
|
|
|
|
|
command = ['checkout', url, checkout_path]
|
|
|
|
|
command = self.AddAdditionalFlags(command, options, revision)
|
|
|
|
|
if revision:
|
|
|
|
|
command.extend(['--revision', str(revision).strip()])
|
|
|
|
|
scm.SVN.RunAndGetFileList(options, command, self._root_dir, file_list)
|
|
|
|
|
return
|
|
|
|
|
|
|
|
|
|
@ -810,7 +812,8 @@ class SVNWrapper(SCMWrapper):
|
|
|
|
|
return
|
|
|
|
|
|
|
|
|
|
command = ["update", checkout_path]
|
|
|
|
|
command = self.AddAdditionalFlags(command, options, revision)
|
|
|
|
|
if revision:
|
|
|
|
|
command.extend(['--revision', str(revision).strip()])
|
|
|
|
|
scm.SVN.RunAndGetFileList(options, command, self._root_dir, file_list)
|
|
|
|
|
|
|
|
|
|
def updatesingle(self, options, args, file_list):
|
|
|
|
|
@ -838,7 +841,8 @@ class SVNWrapper(SCMWrapper):
|
|
|
|
|
os.makedirs(checkout_path)
|
|
|
|
|
command = ["export", os.path.join(self.url, filename),
|
|
|
|
|
os.path.join(checkout_path, filename)]
|
|
|
|
|
command = self.AddAdditionalFlags(command, options, options.revision)
|
|
|
|
|
if options.revision:
|
|
|
|
|
command.extend(['--revision', str(options.revision).strip()])
|
|
|
|
|
scm.SVN.Run(command, self._root_dir)
|
|
|
|
|
|
|
|
|
|
def revert(self, options, args, file_list):
|
|
|
|
|
@ -923,15 +927,3 @@ class SVNWrapper(SCMWrapper):
|
|
|
|
|
def FullUrlForRelativeUrl(self, url):
|
|
|
|
|
# Find the forth '/' and strip from there. A bit hackish.
|
|
|
|
|
return '/'.join(self.url.split('/')[:4]) + url
|
|
|
|
|
|
|
|
|
|
def AddAdditionalFlags(self, command, options, revision):
|
|
|
|
|
"""Add additional flags to command depending on what options are set.
|
|
|
|
|
command should be a list of strings that represents an svn command.
|
|
|
|
|
|
|
|
|
|
This method returns a new list to be used as a command."""
|
|
|
|
|
new_command = command[:]
|
|
|
|
|
if revision:
|
|
|
|
|
new_command.extend(['--revision', str(revision).strip()])
|
|
|
|
|
if options.force:
|
|
|
|
|
new_command.append('--force')
|
|
|
|
|
return new_command
|
|
|
|
|
|