Changeset 61 for mergebot/trunk


Ignore:
Timestamp:
Feb 23, 2010 9:34:49 PM (15 years ago)
Author:
retracile
Message:

Mergebot: convert an os.system call to subprocess

File:
1 edited

Legend:

Unmodified
Added
Removed
  • mergebot/trunk/mergebot/svn.py

    r57 r61  
    3131        """Log the cmd string, then execute it, appending its stdout and stderr
    3232        to logfile."""
    33         open(logfile, "a").write("%s: %s\n" % (time.asctime(), cmd))
    34         return os.system("(%s) >>%s 2>&1" % (cmd, logfile))
     33        log = open(logfile, "a")
     34        log.write("%s: %s\n" % (time.asctime(), cmd))
     35        task = subprocess.Popen(cmd, stdout=log, stderr=log)
     36        task.communicate()
     37        return task.wait()
    3538
    3639    def get_rev_from_log(self, logentry):
     
    7780        """Create a branch copying from_url to to_url.  Commit as mergebot, and
    7881        use the provided commit message."""
    79         svncmd = \
    80             "svn copy --username=mergebot --password=mergebot -m %s %s %s" \
    81             % (shell_quote(commit_message), from_url, to_url)
     82        svncmd = ['svn', 'copy', '--username=mergebot', '--password=mergebot',
     83            '-m', shell_quote(commit_message), from_url, to_url]
    8284        return self.logcmd(svncmd, logfile)
    8385
Note: See TracChangeset for help on using the changeset viewer.