changeset 46201:b986e3342827

debugsetparents: add various warning in the help message I am tired to see people shooting themself in the foot with this. So lets add more warning. At that point we should probably rename it or add extra confirmation flag. This is a debug command anyway we can break BC on it. Differential Revision: https://phab.mercurial-scm.org/D9534
author Pierre-Yves David <pierre-yves.david@octobus.net>
date Mon, 07 Dec 2020 22:27:43 +0100
parents bd31462a86a2
children 5135b393884b
files mercurial/debugcommands.py tests/test-help.t
diffstat 2 files changed, 17 insertions(+), 6 deletions(-) [+]
line wrap: on
line diff
--- a/mercurial/debugcommands.py	Mon Dec 28 03:18:16 2020 +0100
+++ b/mercurial/debugcommands.py	Mon Dec 07 22:27:43 2020 +0100
@@ -3441,12 +3441,22 @@
 
 @command(b'debugsetparents', [], _(b'REV1 [REV2]'))
 def debugsetparents(ui, repo, rev1, rev2=None):
-    """manually set the parents of the current working directory
-
-    This is useful for writing repository conversion tools, but should
-    be used with care. For example, neither the working directory nor the
-    dirstate is updated, so file status may be incorrect after running this
-    command.
+    """manually set the parents of the current working directory (DANGEROUS)
+
+    This command is not what you are looking for and should not be used. Using
+    this command will most certainly results in slight corruption of the file
+    level histories withing your repository. DO NOT USE THIS COMMAND.
+
+    The command update the p1 and p2 field in the dirstate, and not touching
+    anything else. This useful for writing repository conversion tools, but
+    should be used with extreme care. For example, neither the working
+    directory nor the dirstate is updated, so file status may be incorrect
+    after running this command. Only used if you are one of the few people that
+    deeply unstand both conversion tools and file level histories. If you are
+    reading this help, you are not one of this people (most of them sailed west
+    from Mithlond anyway.
+
+    So one last time DO NOT USE THIS COMMAND.
 
     Returns 0 on success.
     """
--- a/tests/test-help.t	Mon Dec 28 03:18:16 2020 +0100
+++ b/tests/test-help.t	Mon Dec 07 22:27:43 2020 +0100
@@ -1068,6 +1068,7 @@
    debugserve    run a server with advanced settings
    debugsetparents
                  manually set the parents of the current working directory
+                 (DANGEROUS)
    debugsidedata
                  dump the side data for a cl/manifest/file revision
    debugssl      test a secure connection to a server