comparison tests/test-split.t @ 45855:c10683da6889

tests: show how `hg split` can put color codes in commit template With D9255, I made it so `hg split` respects the `commmand-templates.oneline-summary` config. I don't think I realized that the output I modified was being put in a commit message template. The result was that if you have coloring enabled, you get colors in the commit template. This patch show that. The test is unfortunately pretty verbose (like most other `hg split` tests) and shows a bunch of irrelevant "color codes" (templater labels). Differential Revision: https://phab.mercurial-scm.org/D9321
author Martin von Zweigbergk <martinvonz@google.com>
date Thu, 12 Nov 2020 17:06:45 -0800
parents b4694ef45db5
children 8357e0e81bb7
comparison
equal deleted inserted replaced
45854:4b4160a83303 45855:c10683da6889
974 b 974 b
975 1 975 1
976 2 976 2
977 3 977 3
978 4 978 4
979
980 Test that color codes don't end up in the commit message template
981 ----------------------------------------------------
982
983 $ hg init $TESTTMP/colorless
984 $ cd $TESTTMP/colorless
985 $ echo 1 > file1
986 $ echo 1 > file2
987 $ hg ci -qAm initial
988 $ echo 2 > file1
989 $ echo 2 > file2
990 $ cat > $TESTTMP/messages <<EOF
991 > split1, modifying file1
992 > --
993 > split2, modifying file2
994 > EOF
995 $ hg ci
996 EDITOR:
997 EDITOR:
998 EDITOR: HG: Enter commit message. Lines beginning with 'HG:' are removed.
999 EDITOR: HG: Leave message empty to abort commit.
1000 EDITOR: HG: --
1001 EDITOR: HG: user: test
1002 EDITOR: HG: branch 'default'
1003 EDITOR: HG: changed file1
1004 EDITOR: HG: changed file2
1005 $ printf 'f\nn\na\n' | hg split --color=debug \
1006 > --config command-templates.oneline-summary='{label("rev", rev)} {desc}'
1007 [diff.diffline|diff --git a/file1 b/file1]
1008 1 hunks, 1 lines changed
1009 [ ui.prompt|examine changes to 'file1'?
1010 (enter ? for help) [Ynesfdaq?]] [ ui.promptecho|f]
1011
1012 [diff.diffline|diff --git a/file2 b/file2]
1013 1 hunks, 1 lines changed
1014 [ ui.prompt|examine changes to 'file2'?
1015 (enter ? for help) [Ynesfdaq?]] [ ui.promptecho|n]
1016
1017 EDITOR: HG: Splitting 6432c65c3078. Write commit message for the first split changeset.
1018 EDITOR: split1, modifying file1
1019 EDITOR:
1020 EDITOR:
1021 EDITOR: HG: Enter commit message. Lines beginning with 'HG:' are removed.
1022 EDITOR: HG: Leave message empty to abort commit.
1023 EDITOR: HG: --
1024 EDITOR: HG: user: test
1025 EDITOR: HG: branch 'default'
1026 EDITOR: HG: changed file1
1027 [ ui.status|created new head]
1028 [diff.diffline|diff --git a/file2 b/file2]
1029 1 hunks, 1 lines changed
1030 [ ui.prompt|examine changes to 'file2'?
1031 (enter ? for help) [Ynesfdaq?]] [ ui.promptecho|a]
1032
1033 EDITOR: HG: Splitting 6432c65c3078. So far it has been split into:
1034 EDITOR: HG: - [rev|2] split2, modifying file2
1035 EDITOR: HG: Write commit message for the next split changeset.
1036 EDITOR: split1, modifying file1
1037 EDITOR:
1038 EDITOR:
1039 EDITOR: HG: Enter commit message. Lines beginning with 'HG:' are removed.
1040 EDITOR: HG: Leave message empty to abort commit.
1041 EDITOR: HG: --
1042 EDITOR: HG: user: test
1043 EDITOR: HG: branch 'default'
1044 EDITOR: HG: changed file2
1045 [ ui.warning|transaction abort!]
1046 [ ui.warning|rollback completed]
1047 [ ui.error|abort: empty commit message]
1048 [10]