diff 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
line wrap: on
line diff
--- a/mercurial/commands.py	Tue Feb 11 11:18:52 2020 +0100
+++ b/mercurial/commands.py	Fri Dec 20 15:50:13 2019 -0800
@@ -2309,6 +2309,7 @@
 @command(
     b'copy|cp',
     [
+        (b'', b'forget', None, _(b'unmark a file as copied')),
         (b'A', b'after', None, _(b'record a copy that has already occurred')),
         (
             b'f',
@@ -2333,8 +2334,11 @@
     exist in the working directory. If invoked with -A/--after, the
     operation is recorded, but no copying is performed.
 
-    This command takes effect with the next commit. To undo a copy
-    before that, see :hg:`revert`.
+    To undo marking a file as copied, use --forget. With that option,
+    all given (positional) arguments are unmarked as copies. The destination
+    file(s) will be left in place (still tracked).
+
+    This command takes effect with the next commit.
 
     Returns 0 on success, 1 if errors are encountered.
     """