Changeset 55 for mergebot/trunk
- Timestamp:
- Feb 23, 2010 7:45:55 PM (15 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
mergebot/trunk/mergebot/svn.py
r50 r55 131 131 skipped_regex = re.compile("Skipped.* '(.*)'", re.M) 132 132 start_rev, end_rev = revision_range 133 pipe = os.popen("cd %s && svn merge --revision %s:%s %s . 2>>%s" % \ 134 (workingdir, start_rev, end_rev, from_url, logfile)) 135 output = pipe.readlines() 133 pipe = subprocess.Popen(['svn', 'merge', '--non-interactive', '--revision', '%s:%s' % (start_rev, end_rev), from_url, '.'], 134 cwd = workingdir, 135 stdout = subprocess.PIPE, 136 stderr = open(logfile, 'a') 137 ) 138 output, _stderr = pipe.communicate() 136 139 # FIXME: check pipe.close for errors 140 # errorcode = pipe.wait() 137 141 results = [] 138 for line in output: 139 if line.startswith("Skipped"): 142 for line in output.split('\n'): 143 if line == '': 144 continue # ignore blank lines 145 elif line.startswith("Skipped"): 140 146 # This kind of conflict requires special handling. 141 147 filename = skipped_regex.findall(line)[0] … … 143 149 elif line.startswith("--- Merging r"): 144 150 continue # ignore the line 151 elif line == 'Summary of conflicts:': 152 continue # ignore the line 153 elif line.startswith(' Text conflicts:'): 154 continue # ignore the line 155 # TODO: Tree conflicts 145 156 else: 146 assert l ine[4] == ' ', "Unexpected output from svn merge" \147 " operation; the 5th character should always be a space." \148 " Output was %r." % line157 assert len(line) > 4 and line[4] == ' ', "Unexpected output " \ 158 "from svn merge operation; the 5th character should " \ 159 "always be a space. Invalid output line was %r.\nFull output was: %r." % (line, output) 149 160 filename = line[5:-1] # (strip trailing newline) 150 161 status = line[:4].rstrip()
Note: See TracChangeset
for help on using the changeset viewer.