Mercurial > hg
comparison mercurial/commands.py @ 44364:8be0c63535b5
copy: add option to unmark file as copied
To unmark a file as copied, the user currently has to do this:
hg forget <dest>
hg add <dest>
The new command simplifies that to:
hg copy --forget <dest>
That's not a very big improvement, but I'm planning to also teach `hg
copy [--forget]` a `--at-rev` argument for marking/unmarking copies
after commit (usually with `--at-rev .`).
Differential Revision: https://phab.mercurial-scm.org/D8029
author | Martin von Zweigbergk <martinvonz@google.com> |
---|---|
date | Fri, 20 Dec 2019 15:50:13 -0800 |
parents | 7a4e1d245f19 |
children | 7c4b98a4e536 |
comparison
equal
deleted
inserted
replaced
44363:f7459da77f23 | 44364:8be0c63535b5 |
---|---|
2307 | 2307 |
2308 | 2308 |
2309 @command( | 2309 @command( |
2310 b'copy|cp', | 2310 b'copy|cp', |
2311 [ | 2311 [ |
2312 (b'', b'forget', None, _(b'unmark a file as copied')), | |
2312 (b'A', b'after', None, _(b'record a copy that has already occurred')), | 2313 (b'A', b'after', None, _(b'record a copy that has already occurred')), |
2313 ( | 2314 ( |
2314 b'f', | 2315 b'f', |
2315 b'force', | 2316 b'force', |
2316 None, | 2317 None, |
2331 | 2332 |
2332 By default, this command copies the contents of files as they | 2333 By default, this command copies the contents of files as they |
2333 exist in the working directory. If invoked with -A/--after, the | 2334 exist in the working directory. If invoked with -A/--after, the |
2334 operation is recorded, but no copying is performed. | 2335 operation is recorded, but no copying is performed. |
2335 | 2336 |
2336 This command takes effect with the next commit. To undo a copy | 2337 To undo marking a file as copied, use --forget. With that option, |
2337 before that, see :hg:`revert`. | 2338 all given (positional) arguments are unmarked as copies. The destination |
2339 file(s) will be left in place (still tracked). | |
2340 | |
2341 This command takes effect with the next commit. | |
2338 | 2342 |
2339 Returns 0 on success, 1 if errors are encountered. | 2343 Returns 0 on success, 1 if errors are encountered. |
2340 """ | 2344 """ |
2341 opts = pycompat.byteskwargs(opts) | 2345 opts = pycompat.byteskwargs(opts) |
2342 with repo.wlock(False): | 2346 with repo.wlock(False): |