Mercurial > public > mercurial-scm > hg-stable
diff mercurial/commands.py @ 2020:00925397236c
merge with crew.
author | Vadim Gelfer <vadim.gelfer@gmail.com> |
---|---|
date | Wed, 29 Mar 2006 10:31:58 -0800 |
parents | ced2d3620f95 ff5c9a92f556 |
children | a59da8cc35e4 |
line wrap: on
line diff
--- 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: