Mercurial > public > mercurial-scm > hg-stable
comparison 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 |
comparison
equal
deleted
inserted
replaced
2019:ced2d3620f95 | 2020:00925397236c |
---|---|
1242 | 1242 |
1243 NOTE: This command should be treated as experimental. While it | 1243 NOTE: This command should be treated as experimental. While it |
1244 should properly record copied files, this information is not yet | 1244 should properly record copied files, this information is not yet |
1245 fully used by merge, nor fully reported by log. | 1245 fully used by merge, nor fully reported by log. |
1246 """ | 1246 """ |
1247 try: | 1247 wlock = repo.wlock(0) |
1248 wlock = repo.wlock(0) | 1248 errs, copied = docopy(ui, repo, pats, opts, wlock) |
1249 errs, copied = docopy(ui, repo, pats, opts, wlock) | |
1250 except lock.LockHeld, inst: | |
1251 ui.warn(_("repository lock held by %s\n") % inst.args[0]) | |
1252 errs = 1 | |
1253 return errs | 1249 return errs |
1254 | 1250 |
1255 def debugancestor(ui, index, rev1, rev2): | 1251 def debugancestor(ui, index, rev1, rev2): |
1256 """find the ancestor revision of two revisions in a given index""" | 1252 """find the ancestor revision of two revisions in a given index""" |
1257 r = revlog.revlog(util.opener(os.getcwd(), audit=False), index, "") | 1253 r = revlog.revlog(util.opener(os.getcwd(), audit=False), index, "") |
2271 | 2267 |
2272 NOTE: This command should be treated as experimental. While it | 2268 NOTE: This command should be treated as experimental. While it |
2273 should properly record rename files, this information is not yet | 2269 should properly record rename files, this information is not yet |
2274 fully used by merge, nor fully reported by log. | 2270 fully used by merge, nor fully reported by log. |
2275 """ | 2271 """ |
2276 try: | 2272 wlock = repo.wlock(0) |
2277 wlock = repo.wlock(0) | 2273 errs, copied = docopy(ui, repo, pats, opts, wlock) |
2278 errs, copied = docopy(ui, repo, pats, opts, wlock) | 2274 names = [] |
2279 names = [] | 2275 for abs, rel, exact in copied: |
2280 for abs, rel, exact in copied: | 2276 if ui.verbose or not exact: |
2281 if ui.verbose or not exact: | 2277 ui.status(_('removing %s\n') % rel) |
2282 ui.status(_('removing %s\n') % rel) | 2278 names.append(abs) |
2283 names.append(abs) | 2279 repo.remove(names, True, wlock) |
2284 repo.remove(names, True, wlock) | |
2285 except lock.LockHeld, inst: | |
2286 ui.warn(_("repository lock held by %s\n") % inst.args[0]) | |
2287 errs = 1 | |
2288 return errs | 2280 return errs |
2289 | 2281 |
2290 def revert(ui, repo, *pats, **opts): | 2282 def revert(ui, repo, *pats, **opts): |
2291 """revert modified files or dirs back to their unmodified states | 2283 """revert modified files or dirs back to their unmodified states |
2292 | 2284 |
3269 u.warn(_("hg: unknown command '%s'\n") % inst.args[0]) | 3261 u.warn(_("hg: unknown command '%s'\n") % inst.args[0]) |
3270 help_(u, 'shortlist') | 3262 help_(u, 'shortlist') |
3271 sys.exit(1) | 3263 sys.exit(1) |
3272 except hg.RepoError, inst: | 3264 except hg.RepoError, inst: |
3273 u.warn(_("abort: "), inst, "!\n") | 3265 u.warn(_("abort: "), inst, "!\n") |
3266 except lock.LockHeld, inst: | |
3267 if inst.errno == errno.ETIMEDOUT: | |
3268 reason = _('timed out waiting for lock held by %s') % inst.locker | |
3269 else: | |
3270 reason = _('lock held by %s') % inst.locker | |
3271 u.warn(_("abort: %s: %s\n") % (inst.desc or inst.filename, reason)) | |
3272 except lock.LockUnavailable, inst: | |
3273 u.warn(_("abort: could not lock %s: %s\n") % | |
3274 (inst.desc or inst.filename, inst.strerror)) | |
3274 except revlog.RevlogError, inst: | 3275 except revlog.RevlogError, inst: |
3275 u.warn(_("abort: "), inst, "!\n") | 3276 u.warn(_("abort: "), inst, "!\n") |
3276 except SignalInterrupt: | 3277 except SignalInterrupt: |
3277 u.warn(_("killed!\n")) | 3278 u.warn(_("killed!\n")) |
3278 except KeyboardInterrupt: | 3279 except KeyboardInterrupt: |