equal
deleted
inserted
replaced
2494 |
2494 |
2495 This command takes effect with the next commit by default. |
2495 This command takes effect with the next commit by default. |
2496 |
2496 |
2497 Returns 0 on success, 1 if errors are encountered. |
2497 Returns 0 on success, 1 if errors are encountered. |
2498 """ |
2498 """ |
2499 opts = pycompat.byteskwargs(opts) |
|
2500 |
2499 |
2501 context = lambda repo: repo.dirstate.changing_files(repo) |
2500 context = lambda repo: repo.dirstate.changing_files(repo) |
2502 rev = opts.get(b'at_rev') |
2501 rev = opts.get('at_rev') |
2503 ctx = None |
2502 ctx = None |
2504 if rev: |
2503 if rev: |
2505 ctx = logcmdutil.revsingle(repo, rev) |
2504 ctx = logcmdutil.revsingle(repo, rev) |
2506 if ctx.rev() is not None: |
2505 if ctx.rev() is not None: |
2507 |
2506 |
2508 def context(repo): |
2507 def context(repo): |
2509 return util.nullcontextmanager() |
2508 return util.nullcontextmanager() |
2510 |
2509 |
2511 opts[b'at_rev'] = ctx.rev() |
2510 opts['at_rev'] = ctx.rev() |
2512 with repo.wlock(), context(repo): |
2511 with repo.wlock(), context(repo): |
2513 return cmdutil.copy(ui, repo, pats, opts) |
2512 return cmdutil.copy(ui, repo, pats, pycompat.byteskwargs(opts)) |
2514 |
2513 |
2515 |
2514 |
2516 @command( |
2515 @command( |
2517 b'debugcommands', |
2516 b'debugcommands', |
2518 [], |
2517 [], |