##// END OF EJS Templates
with: use context manager in amend
Bryan O'Sullivan -
r27868:d1a55366 default
parent child Browse files
Show More
@@ -2512,8 +2512,7 def amend(ui, repo, commitfunc, old, ext
2512 try:
2512 try:
2513 wlock = repo.wlock()
2513 wlock = repo.wlock()
2514 lock = repo.lock()
2514 lock = repo.lock()
2515 tr = repo.transaction('amend')
2515 with repo.transaction('amend') as tr:
2516 try:
2517 # See if we got a message from -m or -l, if not, open the editor
2516 # See if we got a message from -m or -l, if not, open the editor
2518 # with the message of the changeset to amend
2517 # with the message of the changeset to amend
2519 message = logmessage(ui, opts)
2518 message = logmessage(ui, opts)
@@ -2685,9 +2684,6 def amend(ui, repo, commitfunc, old, ext
2685 obs.append((ctx, ()))
2684 obs.append((ctx, ()))
2686
2685
2687 obsolete.createmarkers(repo, obs)
2686 obsolete.createmarkers(repo, obs)
2688 tr.close()
2689 finally:
2690 tr.release()
2691 if not createmarkers and newid != old.node():
2687 if not createmarkers and newid != old.node():
2692 # Strip the intermediate commit (if there was one) and the amended
2688 # Strip the intermediate commit (if there was one) and the amended
2693 # commit
2689 # commit
General Comments 0
You need to be logged in to leave comments. Login now