changeset 6931:237f99ee3d64 stable

tests: remove leading spaces in `hg help` output, run only on Mercurial 6.9+ Core decided to remove a lot of leading spaces in docstrings to support Python 3.13, see 51057ab0dffa for details.
author Anton Shestakov <av6@dwimlabs.net>
date Mon, 11 Nov 2024 10:39:57 +0400
parents 195941260a67
children 2efcacc03010
files tests/test-amend.t tests/test-fixup.t tests/test-topic.t tests/test-tutorial.t
diffstat 4 files changed, 66 insertions(+), 54 deletions(-) [+]
line wrap: on
line diff
--- a/tests/test-amend.t	Mon Nov 11 10:38:20 2024 +0400
+++ b/tests/test-amend.t	Mon Nov 11 10:39:57 2024 +0400
@@ -131,6 +131,7 @@
 setting the user after we have performed the test with no username
   $ HGUSER=test
 
+#if hg69
 Check the help
   $ hg amend -h
   hg amend [OPTION]... [FILE]...
@@ -139,18 +140,18 @@
   
   combine a changeset with updates and replace it with a new one
   
-      Commits a new changeset incorporating both the changes to the given files
-      and all the changes from the current parent changeset into the repository.
+  Commits a new changeset incorporating both the changes to the given files and
+  all the changes from the current parent changeset into the repository.
   
-      See 'hg commit' for details about committing changes.
+  See 'hg commit' for details about committing changes.
   
-      If you don't specify -m, the parent's message will be reused.
+  If you don't specify -m, the parent's message will be reused.
   
-      If --extract is specified, the behavior of 'hg amend' is reversed: Changes
-      to selected files in the checked out revision appear again as uncommitted
-      changed in the working directory.
+  If --extract is specified, the behavior of 'hg amend' is reversed: Changes to
+  selected files in the checked out revision appear again as uncommitted changed
+  in the working directory.
   
-      Returns 0 on success, 1 if nothing changed.
+  Returns 0 on success, 1 if nothing changed.
   
   options ([+] can be repeated):
   
@@ -175,6 +176,7 @@
    -i --interactive         use interactive mode
   
   (some details hidden, use --verbose to show complete help)
+#endif
 
 Check that we abort if --patch and --extract both are used at once
   $ hg amend --patch --extract
--- a/tests/test-fixup.t	Mon Nov 11 10:38:20 2024 +0400
+++ b/tests/test-fixup.t	Mon Nov 11 10:39:57 2024 +0400
@@ -12,6 +12,7 @@
   > git = 1
   > EOF
 
+#if hg69
   $ hg help fixup
   hg fixup [OPTION]... [-r] REV
   
@@ -19,22 +20,22 @@
   
   add working directory changes to an arbitrary revision
   
-      A new changeset will be created, superseding the one specified. The new
-      changeset will combine working directory changes with the changes in the
-      target revision.
+  A new changeset will be created, superseding the one specified. The new
+  changeset will combine working directory changes with the changes in the
+  target revision.
   
-      This operation requires the working directory changes to be relocated onto
-      the target revision, which might result in merge conflicts.
+  This operation requires the working directory changes to be relocated onto the
+  target revision, which might result in merge conflicts.
   
-      If fixup is interrupted to manually resolve a conflict, it can be
-      continued with --continue/-c, or aborted with --abort.
+  If fixup is interrupted to manually resolve a conflict, it can be continued
+  with --continue/-c, or aborted with --abort.
   
-      Note that this command is fairly new and its behavior is still
-      experimental. For example, the working copy will be left on a temporary,
-      obsolete commit containing the fixed-up changes after the operation. This
-      might change in the future.
+  Note that this command is fairly new and its behavior is still experimental.
+  For example, the working copy will be left on a temporary, obsolete commit
+  containing the fixed-up changes after the operation. This might change in the
+  future.
   
-      Returns 0 on success, 1 if nothing changed.
+  Returns 0 on success, 1 if nothing changed.
   
   options:
   
@@ -43,6 +44,7 @@
       --abort    abort an interrupted fixup
   
   (some details hidden, use --verbose to show complete help)
+#endif
 
 Simple cases
 ------------
--- a/tests/test-topic.t	Mon Nov 11 10:38:20 2024 +0400
+++ b/tests/test-topic.t	Mon Nov 11 10:39:57 2024 +0400
@@ -171,45 +171,47 @@
    stack         list all changesets in a topic and other information
   
   (use 'hg help -v topic' to show built-in aliases and global options)
+
+#if hg69
   $ hg help topics
   hg topics [OPTION]... [-r REV]... [TOPIC]
   
   View current topic, set current topic, change topic for a set of revisions, or
   see all topics.
   
-      Clear topic on existing topiced revisions:
+  Clear topic on existing topiced revisions:
   
-        hg topics --rev <related revset> --clear
+    hg topics --rev <related revset> --clear
   
-      Change topic on some revisions:
+  Change topic on some revisions:
   
-        hg topics <newtopicname> --rev <related revset>
+    hg topics <newtopicname> --rev <related revset>
   
-      Clear current topic:
+  Clear current topic:
   
-        hg topics --clear
+    hg topics --clear
   
-      Set current topic:
+  Set current topic:
   
-        hg topics <topicname>
+    hg topics <topicname>
   
-      List of topics:
+  List of topics:
   
-        hg topics
+    hg topics
   
-      List of topics sorted according to their last touched time displaying last
-      touched time and the user who last touched the topic:
+  List of topics sorted according to their last touched time displaying last
+  touched time and the user who last touched the topic:
   
-        hg topics --age
+    hg topics --age
   
-      The active topic (if any) will be prepended with a "*".
+  The active topic (if any) will be prepended with a "*".
   
-      The '--current' flag helps to take active topic into account. For example,
-      if you want to set the topic on all the draft changesets to the active
-      topic, you can do: 'hg topics -r "draft()" --current'
+  The '--current' flag helps to take active topic into account. For example, if
+  you want to set the topic on all the draft changesets to the active topic, you
+  can do: 'hg topics -r "draft()" --current'
   
-      The --verbose version of this command display various information on the
-      state of each topic.
+  The --verbose version of this command display various information on the state
+  of each topic.
   
   options ([+] can be repeated):
   
@@ -221,6 +223,8 @@
    -T --template TEMPLATE display with template
   
   (some details hidden, use --verbose to show complete help)
+#endif
+
   $ hg topics
 
 Test topics interaction with evolution:
--- a/tests/test-tutorial.t	Mon Nov 11 10:38:20 2024 +0400
+++ b/tests/test-tutorial.t	Mon Nov 11 10:39:57 2024 +0400
@@ -910,24 +910,25 @@
 This part is not written yet, but you can use either the `histedit` extension
 or the `uncommit` command to split a change.
 
+#if hg69
   $ hg help uncommit
   hg uncommit [OPTION]... [FILE]...
   
   move changes from parent revision to working directory
   
-      Changes to selected files in the checked out revision appear again as
-      uncommitted changed in the working directory. A new revision without the
-      selected changes is created, becomes the checked out revision, and
-      obsoletes the previous one.
+  Changes to selected files in the checked out revision appear again as
+  uncommitted changed in the working directory. A new revision without the
+  selected changes is created, becomes the checked out revision, and obsoletes
+  the previous one.
   
-      The --include option specifies patterns to uncommit. The --exclude option
-      specifies patterns to keep in the commit.
+  The --include option specifies patterns to uncommit. The --exclude option
+  specifies patterns to keep in the commit.
   
-      The --rev argument let you change the commit file to a content of another
-      revision. It still does not change the content of your file in the working
-      directory.
+  The --rev argument let you change the commit file to a content of another
+  revision. It still does not change the content of your file in the working
+  directory.
   
-      Return 0 if changed files are uncommitted.
+  Return 0 if changed files are uncommitted.
   
   options ([+] can be repeated):
   
@@ -945,6 +946,7 @@
    -U --current-user        record the current user as committer
   
   (some details hidden, use --verbose to show complete help)
+#endif
 
 
 The edit command of histedit can be used to split changeset:
@@ -955,6 +957,7 @@
 
 The tutorial part is not written yet but can use `hg fold`:
 
+#if hg69
   $ hg help fold
   hg fold [OPTION]... [-r] REV...
   
@@ -962,12 +965,12 @@
   
   fold multiple revisions into a single one
   
-      With --from, folds all the revisions linearly between the given revisions
-      and the parent of the working directory.
+  With --from, folds all the revisions linearly between the given revisions and
+  the parent of the working directory.
   
-      With --exact, folds only the specified revisions while ignoring the parent
-      of the working directory. In this case, the given revisions must form a
-      linear unbroken chain.
+  With --exact, folds only the specified revisions while ignoring the parent of
+  the working directory. In this case, the given revisions must form a linear
+  unbroken chain.
   
   options ([+] can be repeated):
   
@@ -983,6 +986,7 @@
    -U --current-user record the current user as committer
   
   (some details hidden, use --verbose to show complete help)
+#endif
 
 
 -----------------------