comparison mercurial/commands.py @ 46886:37f49d462394

rename: add --forget option and stop suggesting `hg revert` for undoing Differential Revision: https://phab.mercurial-scm.org/D10355
author Martin von Zweigbergk <martinvonz@google.com>
date Fri, 09 Apr 2021 08:46:40 -0700
parents d4ba4d51f85f
children ffd3e823a7e5
comparison
equal deleted inserted replaced
46885:fc8a5c9ecee0 46886:37f49d462394
2411 exist in the working directory. If invoked with -A/--after, the 2411 exist in the working directory. If invoked with -A/--after, the
2412 operation is recorded, but no copying is performed. 2412 operation is recorded, but no copying is performed.
2413 2413
2414 To undo marking a destination file as copied, use --forget. With that 2414 To undo marking a destination file as copied, use --forget. With that
2415 option, all given (positional) arguments are unmarked as copies. The 2415 option, all given (positional) arguments are unmarked as copies. The
2416 destination file(s) will be left in place (still tracked). 2416 destination file(s) will be left in place (still tracked). Note that
2417 :hg:`copy --forget` behaves the same way as :hg:`rename --forget`.
2417 2418
2418 This command takes effect with the next commit by default. 2419 This command takes effect with the next commit by default.
2419 2420
2420 Returns 0 on success, 1 if errors are encountered. 2421 Returns 0 on success, 1 if errors are encountered.
2421 """ 2422 """
5912 5913
5913 5914
5914 @command( 5915 @command(
5915 b'rename|move|mv', 5916 b'rename|move|mv',
5916 [ 5917 [
5918 (b'', b'forget', None, _(b'unmark a destination file as renamed')),
5917 (b'A', b'after', None, _(b'record a rename that has already occurred')), 5919 (b'A', b'after', None, _(b'record a rename that has already occurred')),
5918 ( 5920 (
5919 b'', 5921 b'',
5920 b'at-rev', 5922 b'at-rev',
5921 b'', 5923 b'',
5943 5945
5944 By default, this command copies the contents of files as they 5946 By default, this command copies the contents of files as they
5945 exist in the working directory. If invoked with -A/--after, the 5947 exist in the working directory. If invoked with -A/--after, the
5946 operation is recorded, but no copying is performed. 5948 operation is recorded, but no copying is performed.
5947 5949
5948 This command takes effect at the next commit. To undo a rename 5950 To undo marking a destination file as renamed, use --forget. With that
5949 before that, see :hg:`revert`. 5951 option, all given (positional) arguments are unmarked as renames. The
5952 destination file(s) will be left in place (still tracked). The source
5953 file(s) will not be restored. Note that :hg:`rename --forget` behaves
5954 the same way as :hg:`copy --forget`.
5955
5956 This command takes effect with the next commit by default.
5950 5957
5951 Returns 0 on success, 1 if errors are encountered. 5958 Returns 0 on success, 1 if errors are encountered.
5952 """ 5959 """
5953 opts = pycompat.byteskwargs(opts) 5960 opts = pycompat.byteskwargs(opts)
5954 with repo.wlock(): 5961 with repo.wlock():