--- a/mercurial/commands.py Wed Mar 29 10:27:16 2006 -0800
+++ b/mercurial/commands.py Wed Mar 29 10:31:58 2006 -0800
@@ -1244,12 +1244,8 @@
should properly record copied files, this information is not yet
fully used by merge, nor fully reported by log.
"""
- try:
- wlock = repo.wlock(0)
- errs, copied = docopy(ui, repo, pats, opts, wlock)
- except lock.LockHeld, inst:
- ui.warn(_("repository lock held by %s\n") % inst.args[0])
- errs = 1
+ wlock = repo.wlock(0)
+ errs, copied = docopy(ui, repo, pats, opts, wlock)
return errs
def debugancestor(ui, index, rev1, rev2):
@@ -2273,18 +2269,14 @@
should properly record rename files, this information is not yet
fully used by merge, nor fully reported by log.
"""
- try:
- wlock = repo.wlock(0)
- errs, copied = docopy(ui, repo, pats, opts, wlock)
- names = []
- for abs, rel, exact in copied:
- if ui.verbose or not exact:
- ui.status(_('removing %s\n') % rel)
- names.append(abs)
- repo.remove(names, True, wlock)
- except lock.LockHeld, inst:
- ui.warn(_("repository lock held by %s\n") % inst.args[0])
- errs = 1
+ wlock = repo.wlock(0)
+ errs, copied = docopy(ui, repo, pats, opts, wlock)
+ names = []
+ for abs, rel, exact in copied:
+ if ui.verbose or not exact:
+ ui.status(_('removing %s\n') % rel)
+ names.append(abs)
+ repo.remove(names, True, wlock)
return errs
def revert(ui, repo, *pats, **opts):
@@ -3271,6 +3263,15 @@
sys.exit(1)
except hg.RepoError, inst:
u.warn(_("abort: "), inst, "!\n")
+ except lock.LockHeld, inst:
+ if inst.errno == errno.ETIMEDOUT:
+ reason = _('timed out waiting for lock held by %s') % inst.locker
+ else:
+ reason = _('lock held by %s') % inst.locker
+ u.warn(_("abort: %s: %s\n") % (inst.desc or inst.filename, reason))
+ except lock.LockUnavailable, inst:
+ u.warn(_("abort: could not lock %s: %s\n") %
+ (inst.desc or inst.filename, inst.strerror))
except revlog.RevlogError, inst:
u.warn(_("abort: "), inst, "!\n")
except SignalInterrupt: