Skip to content

Commit 7d5fa20

Browse files
committed
only prompt if title has been modified
1 parent 8c195bb commit 7d5fa20

File tree

1 file changed

+13
-9
lines changed

1 file changed

+13
-9
lines changed

dev/merge_spark_pr.py

Lines changed: 13 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -354,17 +354,21 @@ def main():
354354
url = pr["url"]
355355

356356
# Decide whether to use the modified title or not
357-
print "I've re-written the title as follows to match the standard format:"
358-
print "Original: %s" % pr["title"]
359-
print "Modified: %s" % standardize_jira_ref(pr["title"])
360-
result = raw_input("Would you like to use the modified title? (y/n): ")
361-
if result.lower() == "y":
362-
title = standardize_jira_ref(pr["title"])
363-
print "Using modified title:"
357+
modified_title = standardize_jira_ref(pr["title"])
358+
if modified_title != pr["title"]:
359+
print "I've re-written the title as follows to match the standard format:"
360+
print "Original: %s" % pr["title"]
361+
print "Modified: %s" % modified_title
362+
result = raw_input("Would you like to use the modified title? (y/n): ")
363+
if result.lower() == "y":
364+
title = modified_title
365+
print "Using modified title:"
366+
else:
367+
title = pr["title"]
368+
print "Using original title:"
369+
print title
364370
else:
365371
title = pr["title"]
366-
print "Using original title:"
367-
print title
368372

369373
body = pr["body"]
370374
target_ref = pr["base"]["ref"]

0 commit comments

Comments
 (0)