Changeset 34
- Timestamp:
- Feb 22, 2010 5:14:43 PM (15 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
mergebot/trunk/mergebot/svn.py
r33 r34 10 10 import subprocess 11 11 12 def shell_quote(self, string): 13 """Given a string, escape the characters interpretted by the shell.""" 14 for char in ["\\", "\"", "$"]: 15 string = string.replace(char, "\\%s" % (char, )) 16 return '"%s"' % (string, ) 17 18 12 19 class SvnLib(object): 13 20 def __init__(self): 14 21 pass 15 16 def shell_quote(self, string):17 """Given a string, escape the characters interpretted by the shell."""18 for char in ["\\", "\"", "$"]:19 string = string.replace(char, "\\%s" % (char, ))20 return '"%s"' % (string, )21 22 22 23 def logcmd(self, cmd, logfile): … … 59 60 # If there have been no commits on the branch since it was created, there 60 61 # will only be one revision listed.... but the log will split into 3 parts. 61 endrev = get_rev_from_log(logs[1])62 startrev = get_rev_from_log(logs[-2])62 endrev = self.get_rev_from_log(logs[1]) 63 startrev = self.get_rev_from_log(logs[-2]) 63 64 return (startrev, endrev) 64 65 … … 69 70 "svn copy --username=mergebot --password=mergebot -m %s %s %s" \ 70 71 % (shell_quote(commit_message), from_url, to_url) 71 return logcmd(svncmd, logfile)72 return self.logcmd(svncmd, logfile) 72 73 73 74 def delete_branch(self, url, commit_message, logfile): … … 78 79 svncmd = "svn rm --no-auth-cache --username=mergebot --password=mergebot " \ 79 80 "-m %s %s 2>>%s" % (shell_quote(commit_message), url, logfile) 80 return _svn_new_rev_command(svncmd)81 return self._svn_new_rev_command(svncmd) 81 82 82 83 def checkout(self, from_url, workingdir, logfile): … … 120 121 "--password=mergebot -m %s 2>>%s" % (workingdir, 121 122 shell_quote(commit_message), logfile) 122 return _svn_new_rev_command(svncmd)123 return self._svn_new_rev_command(svncmd) 123 124 124 125 def _svn_new_rev_command(self, svncmd):
Note: See TracChangeset
for help on using the changeset viewer.