Skip to content

Commit 893015b

Browse files
committed
Tweaked mergeready to accept an additional hold-for-merge file outside the repository.
- Legacy-Id: 14894
1 parent 0b0256c commit 893015b

1 file changed

Lines changed: 8 additions & 1 deletion

File tree

bin/mergeready

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -216,7 +216,11 @@ def get_changeset_list_from_file(repo, filename):
216216
and hold-for-merge files.
217217
"""
218218
list = []
219-
note("Reading list from '%s'" % filename)
219+
if os.path.exists(filename):
220+
note("Reading list from '%s'" % filename)
221+
else:
222+
note("File doesn't exist: '%s'" % filename)
223+
return list
220224
with open(filename) as file:
221225
for line in file:
222226
line = line.strip()
@@ -231,6 +235,8 @@ def get_changeset_list_from_file(repo, filename):
231235
else:
232236
changeset = parts[0]
233237
branch, rev = changeset.split('@')
238+
if branch.startswith('^'):
239+
branch = branch[1:]
234240
if branch.startswith('/'):
235241
branch = branch[1:]
236242
if not (rev in merged_revs and branch == merged_revs[rev]):
@@ -277,6 +283,7 @@ def get_ready_commits(repo, tree):
277283

278284
ready = get_changeset_list_from_file(repo, 'ready-for-merge')
279285
hold = get_changeset_list_from_file(repo, 'hold-for-merge')
286+
hold += get_changeset_list_from_file(repo, '../hold-for-merge')
280287
ready += get_ready_commits(repo, 'personal')
281288
ready += get_ready_commits(repo, 'branch/amsl')
282289
ready += get_ready_commits(repo, 'branch/iola')

0 commit comments

Comments
 (0)