Skip to content

Commit 679ec63

Browse files
committed
Fixed a problem with the latest mergeready enhancement.
- Legacy-Id: 11788
1 parent dd4d7ae commit 679ec63

1 file changed

Lines changed: 13 additions & 3 deletions

File tree

bin/mergeready

Lines changed: 13 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -238,12 +238,15 @@ def get_ready_commits(repo, tree):
238238
note("Running '%s' ..." % cmd)
239239
commit_log = pipe(cmd)
240240
for line in commit_log.splitlines():
241-
if re.search('^r[0-9]+ ', line):
241+
if re.search('^r[0-9]+ \|', line):
242242
rev, who, when = split_loginfo(line)
243243
branch = None
244244
continue
245245
if (line.startswith(' M') or line.startswith(' A') or line.startswith(' D')) and branch == None:
246246
type, path = line[:4], line[5:]
247+
if ' (from ' in path:
248+
i = path.index(' (from ')
249+
path = path[:i]
247250
branch = '/'.join(path.split('/')[1:4])
248251
elif re.search("(?i)((commit|branch) ready (for|to) merge)", line):
249252
if not rev in merged_revs:
@@ -306,18 +309,25 @@ for entry in ready:
306309
ready_commits[when] = output_line
307310
else:
308311
not_passed[when] = output_line
309-
310312
unmerged_branch_commits = {}
311313
for branch in branches:
312314
note("Fetching commit information for branch %s" % branch)
313315
commits = []
314316
cmd = 'svn log -v -r 0:HEAD --stop-on-copy %s/%s/' % (repo, branch)
315317
commit_log = pipe(cmd)
316-
for line in commit_log.splitlines()[3:]:
318+
rev = None
319+
mod = False
320+
for line in commit_log.splitlines():
317321
if re.search('^r[0-9]+ ', line):
318322
rev, who, when = split_loginfo(line)
323+
elif re.search('^ [AMD]', line):
324+
if not ' (from ' in line:
325+
mod = True
326+
elif re.search('^-{72}$', line) and rev and mod:
319327
if not rev in merged_revs:
320328
commits.append(rev)
329+
rev = None
330+
mod = False
321331
commits.sort()
322332
unmerged_branch_commits[branch] = commits
323333

0 commit comments

Comments
 (0)