##// END OF EJS Templates
amend: lock the repository during the whole process...
Pierre-Yves David -
r17471:ad156172 default
parent child Browse files
Show More
@@ -11,6 +11,7 b' import os, sys, errno, re, tempfile'
11 import util, scmutil, templater, patch, error, templatekw, revlog, copies
11 import util, scmutil, templater, patch, error, templatekw, revlog, copies
12 import match as matchmod
12 import match as matchmod
13 import subrepo, context, repair, bookmarks, graphmod, revset, phases
13 import subrepo, context, repair, bookmarks, graphmod, revset, phases
14 import lock as lockmod
14
15
15 def parsealiases(cmd):
16 def parsealiases(cmd):
16 return cmd.lstrip("^").split("|")
17 return cmd.lstrip("^").split("|")
@@ -1575,8 +1576,10 b' def amend(ui, repo, commitfunc, old, ext'
1575 ui.note(_('amending changeset %s\n') % old)
1576 ui.note(_('amending changeset %s\n') % old)
1576 base = old.p1()
1577 base = old.p1()
1577
1578
1578 wlock = repo.wlock()
1579 wlock = lock = None
1579 try:
1580 try:
1581 wlock = repo.wlock()
1582 lock = repo.lock()
1580 # First, do a regular commit to record all changes in the working
1583 # First, do a regular commit to record all changes in the working
1581 # directory (if there are any)
1584 # directory (if there are any)
1582 ui.callhooks = False
1585 ui.callhooks = False
@@ -1694,16 +1697,12 b' def amend(ui, repo, commitfunc, old, ext'
1694
1697
1695 # Strip the intermediate commit (if there was one) and the amended
1698 # Strip the intermediate commit (if there was one) and the amended
1696 # commit
1699 # commit
1697 lock = repo.lock()
1700 if node:
1698 try:
1701 ui.note(_('stripping intermediate changeset %s\n') % ctx)
1699 if node:
1702 ui.note(_('stripping amended changeset %s\n') % old)
1700 ui.note(_('stripping intermediate changeset %s\n') % ctx)
1703 repair.strip(ui, repo, old.node(), topic='amend-backup')
1701 ui.note(_('stripping amended changeset %s\n') % old)
1702 repair.strip(ui, repo, old.node(), topic='amend-backup')
1703 finally:
1704 lock.release()
1705 finally:
1704 finally:
1706 wlock.release()
1705 lockmod.release(wlock, lock)
1707 return newid
1706 return newid
1708
1707
1709 def commiteditor(repo, ctx, subs):
1708 def commiteditor(repo, ctx, subs):
General Comments 0
You need to be logged in to leave comments. Login now