##// END OF EJS Templates
amend: use context manager for locking
Martin von Zweigbergk -
r32921:5694311d default
parent child Browse files
Show More
@@ -30,7 +30,6 b' from . import ('
30 30 error,
31 31 formatter,
32 32 graphmod,
33 lock as lockmod,
34 33 match as matchmod,
35 34 obsolete,
36 35 patch,
@@ -2730,10 +2729,8 b' def amend(ui, repo, commitfunc, old, ext'
2730 2729 base = old.p1()
2731 2730 createmarkers = obsolete.isenabled(repo, obsolete.createmarkersopt)
2732 2731
2733 wlock = lock = newid = None
2734 try:
2735 wlock = repo.wlock()
2736 lock = repo.lock()
2732 newid = None
2733 with repo.wlock(), repo.lock():
2737 2734 with repo.transaction('amend') as tr:
2738 2735 # See if we got a message from -m or -l, if not, open the editor
2739 2736 # with the message of the changeset to amend
@@ -2896,8 +2893,6 b' def amend(ui, repo, commitfunc, old, ext'
2896 2893 ui.note(_('stripping intermediate changeset %s\n') % ctx)
2897 2894 ui.note(_('stripping amended changeset %s\n') % old)
2898 2895 repair.strip(ui, repo, old.node(), topic='amend-backup')
2899 finally:
2900 lockmod.release(lock, wlock)
2901 2896 return newid
2902 2897
2903 2898 def commiteditor(repo, ctx, subs, editform=''):
General Comments 0
You need to be logged in to leave comments. Login now