annotate tests/test-issue6550.t @ 6937:47b41d441ff3 stable tip

changelog: add evolve 11.1.6 items
author Anton Shestakov <av6@dwimlabs.net>
date Fri, 22 Nov 2024 18:02:25 +0400
parents b883fc38e07c
children
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
6116
b0443b54160c tests: add a test case for https://bz.mercurial-scm.org/show_bug.cgi?id=6550
Simon Sapin <simon.sapin@octobus.net>
parents:
diff changeset
1 histedit should preserve topics (issue6550)
b0443b54160c tests: add a test case for https://bz.mercurial-scm.org/show_bug.cgi?id=6550
Simon Sapin <simon.sapin@octobus.net>
parents:
diff changeset
2 https://bz.mercurial-scm.org/show_bug.cgi?id=6550
b0443b54160c tests: add a test case for https://bz.mercurial-scm.org/show_bug.cgi?id=6550
Simon Sapin <simon.sapin@octobus.net>
parents:
diff changeset
3
b0443b54160c tests: add a test case for https://bz.mercurial-scm.org/show_bug.cgi?id=6550
Simon Sapin <simon.sapin@octobus.net>
parents:
diff changeset
4 $ . "$TESTDIR/testlib/topic_setup.sh"
b0443b54160c tests: add a test case for https://bz.mercurial-scm.org/show_bug.cgi?id=6550
Simon Sapin <simon.sapin@octobus.net>
parents:
diff changeset
5
b0443b54160c tests: add a test case for https://bz.mercurial-scm.org/show_bug.cgi?id=6550
Simon Sapin <simon.sapin@octobus.net>
parents:
diff changeset
6 $ cat << EOF >> "$HGRCPATH"
b0443b54160c tests: add a test case for https://bz.mercurial-scm.org/show_bug.cgi?id=6550
Simon Sapin <simon.sapin@octobus.net>
parents:
diff changeset
7 > [extensions]
b0443b54160c tests: add a test case for https://bz.mercurial-scm.org/show_bug.cgi?id=6550
Simon Sapin <simon.sapin@octobus.net>
parents:
diff changeset
8 > histedit =
b0443b54160c tests: add a test case for https://bz.mercurial-scm.org/show_bug.cgi?id=6550
Simon Sapin <simon.sapin@octobus.net>
parents:
diff changeset
9 > [alias]
b0443b54160c tests: add a test case for https://bz.mercurial-scm.org/show_bug.cgi?id=6550
Simon Sapin <simon.sapin@octobus.net>
parents:
diff changeset
10 > glog = log -G --template "{rev}:{node|short} [{topic}] {desc}\n"
b0443b54160c tests: add a test case for https://bz.mercurial-scm.org/show_bug.cgi?id=6550
Simon Sapin <simon.sapin@octobus.net>
parents:
diff changeset
11 > EOF
b0443b54160c tests: add a test case for https://bz.mercurial-scm.org/show_bug.cgi?id=6550
Simon Sapin <simon.sapin@octobus.net>
parents:
diff changeset
12
b0443b54160c tests: add a test case for https://bz.mercurial-scm.org/show_bug.cgi?id=6550
Simon Sapin <simon.sapin@octobus.net>
parents:
diff changeset
13 Editing commits with one topic on top of a commit with a different topic:
b0443b54160c tests: add a test case for https://bz.mercurial-scm.org/show_bug.cgi?id=6550
Simon Sapin <simon.sapin@octobus.net>
parents:
diff changeset
14
b0443b54160c tests: add a test case for https://bz.mercurial-scm.org/show_bug.cgi?id=6550
Simon Sapin <simon.sapin@octobus.net>
parents:
diff changeset
15 $ hg init repo1
b0443b54160c tests: add a test case for https://bz.mercurial-scm.org/show_bug.cgi?id=6550
Simon Sapin <simon.sapin@octobus.net>
parents:
diff changeset
16 $ cd repo1
b0443b54160c tests: add a test case for https://bz.mercurial-scm.org/show_bug.cgi?id=6550
Simon Sapin <simon.sapin@octobus.net>
parents:
diff changeset
17 $ hg topic topic1
b0443b54160c tests: add a test case for https://bz.mercurial-scm.org/show_bug.cgi?id=6550
Simon Sapin <simon.sapin@octobus.net>
parents:
diff changeset
18 marked working directory as topic: topic1
b0443b54160c tests: add a test case for https://bz.mercurial-scm.org/show_bug.cgi?id=6550
Simon Sapin <simon.sapin@octobus.net>
parents:
diff changeset
19 $ echo 1 > A
b0443b54160c tests: add a test case for https://bz.mercurial-scm.org/show_bug.cgi?id=6550
Simon Sapin <simon.sapin@octobus.net>
parents:
diff changeset
20 $ hg ci -Aqm A
b0443b54160c tests: add a test case for https://bz.mercurial-scm.org/show_bug.cgi?id=6550
Simon Sapin <simon.sapin@octobus.net>
parents:
diff changeset
21 $ hg topic topic2
b0443b54160c tests: add a test case for https://bz.mercurial-scm.org/show_bug.cgi?id=6550
Simon Sapin <simon.sapin@octobus.net>
parents:
diff changeset
22 $ echo 1 > B
b0443b54160c tests: add a test case for https://bz.mercurial-scm.org/show_bug.cgi?id=6550
Simon Sapin <simon.sapin@octobus.net>
parents:
diff changeset
23 $ hg ci -Aqm B
b0443b54160c tests: add a test case for https://bz.mercurial-scm.org/show_bug.cgi?id=6550
Simon Sapin <simon.sapin@octobus.net>
parents:
diff changeset
24 $ echo 1 > C
b0443b54160c tests: add a test case for https://bz.mercurial-scm.org/show_bug.cgi?id=6550
Simon Sapin <simon.sapin@octobus.net>
parents:
diff changeset
25 $ hg ci -Aqm C
b0443b54160c tests: add a test case for https://bz.mercurial-scm.org/show_bug.cgi?id=6550
Simon Sapin <simon.sapin@octobus.net>
parents:
diff changeset
26 $ hg glog
b0443b54160c tests: add a test case for https://bz.mercurial-scm.org/show_bug.cgi?id=6550
Simon Sapin <simon.sapin@octobus.net>
parents:
diff changeset
27 @ 2:392a64d00726 [topic2] C
b0443b54160c tests: add a test case for https://bz.mercurial-scm.org/show_bug.cgi?id=6550
Simon Sapin <simon.sapin@octobus.net>
parents:
diff changeset
28 |
b0443b54160c tests: add a test case for https://bz.mercurial-scm.org/show_bug.cgi?id=6550
Simon Sapin <simon.sapin@octobus.net>
parents:
diff changeset
29 o 1:8a25a1549e46 [topic2] B
b0443b54160c tests: add a test case for https://bz.mercurial-scm.org/show_bug.cgi?id=6550
Simon Sapin <simon.sapin@octobus.net>
parents:
diff changeset
30 |
b0443b54160c tests: add a test case for https://bz.mercurial-scm.org/show_bug.cgi?id=6550
Simon Sapin <simon.sapin@octobus.net>
parents:
diff changeset
31 o 0:c051488dac25 [topic1] A
b0443b54160c tests: add a test case for https://bz.mercurial-scm.org/show_bug.cgi?id=6550
Simon Sapin <simon.sapin@octobus.net>
parents:
diff changeset
32
b0443b54160c tests: add a test case for https://bz.mercurial-scm.org/show_bug.cgi?id=6550
Simon Sapin <simon.sapin@octobus.net>
parents:
diff changeset
33 Swap the order of commits B and C
b0443b54160c tests: add a test case for https://bz.mercurial-scm.org/show_bug.cgi?id=6550
Simon Sapin <simon.sapin@octobus.net>
parents:
diff changeset
34
b0443b54160c tests: add a test case for https://bz.mercurial-scm.org/show_bug.cgi?id=6550
Simon Sapin <simon.sapin@octobus.net>
parents:
diff changeset
35 $ hg histedit s1 -q --commands - 2>&1 << EOF
b0443b54160c tests: add a test case for https://bz.mercurial-scm.org/show_bug.cgi?id=6550
Simon Sapin <simon.sapin@octobus.net>
parents:
diff changeset
36 > pick 392a64d00726 C
b0443b54160c tests: add a test case for https://bz.mercurial-scm.org/show_bug.cgi?id=6550
Simon Sapin <simon.sapin@octobus.net>
parents:
diff changeset
37 > pick 8a25a1549e46 B
b0443b54160c tests: add a test case for https://bz.mercurial-scm.org/show_bug.cgi?id=6550
Simon Sapin <simon.sapin@octobus.net>
parents:
diff changeset
38 > EOF
b0443b54160c tests: add a test case for https://bz.mercurial-scm.org/show_bug.cgi?id=6550
Simon Sapin <simon.sapin@octobus.net>
parents:
diff changeset
39
6117
a27bdd116761 topic: wrap applychange from histedit to preserve topics
Simon Sapin <simon.sapin@octobus.net>
parents: 6116
diff changeset
40 Topic of B and C is preserved
6116
b0443b54160c tests: add a test case for https://bz.mercurial-scm.org/show_bug.cgi?id=6550
Simon Sapin <simon.sapin@octobus.net>
parents:
diff changeset
41
b0443b54160c tests: add a test case for https://bz.mercurial-scm.org/show_bug.cgi?id=6550
Simon Sapin <simon.sapin@octobus.net>
parents:
diff changeset
42 $ hg glog
6117
a27bdd116761 topic: wrap applychange from histedit to preserve topics
Simon Sapin <simon.sapin@octobus.net>
parents: 6116
diff changeset
43 @ 4:065a99df807b [topic2] B
6116
b0443b54160c tests: add a test case for https://bz.mercurial-scm.org/show_bug.cgi?id=6550
Simon Sapin <simon.sapin@octobus.net>
parents:
diff changeset
44 |
6117
a27bdd116761 topic: wrap applychange from histedit to preserve topics
Simon Sapin <simon.sapin@octobus.net>
parents: 6116
diff changeset
45 o 3:43dddca3e1d1 [topic2] C
6116
b0443b54160c tests: add a test case for https://bz.mercurial-scm.org/show_bug.cgi?id=6550
Simon Sapin <simon.sapin@octobus.net>
parents:
diff changeset
46 |
b0443b54160c tests: add a test case for https://bz.mercurial-scm.org/show_bug.cgi?id=6550
Simon Sapin <simon.sapin@octobus.net>
parents:
diff changeset
47 o 0:c051488dac25 [topic1] A
b0443b54160c tests: add a test case for https://bz.mercurial-scm.org/show_bug.cgi?id=6550
Simon Sapin <simon.sapin@octobus.net>
parents:
diff changeset
48
b0443b54160c tests: add a test case for https://bz.mercurial-scm.org/show_bug.cgi?id=6550
Simon Sapin <simon.sapin@octobus.net>
parents:
diff changeset
49 $ cd ..
6118
5d1bfde39b95 topic: also make histedit clear the current topic if needed
Simon Sapin <simon.sapin@octobus.net>
parents: 6117
diff changeset
50
5d1bfde39b95 topic: also make histedit clear the current topic if needed
Simon Sapin <simon.sapin@octobus.net>
parents: 6117
diff changeset
51 Editing commits without a topic on top of a commit with a topic:
5d1bfde39b95 topic: also make histedit clear the current topic if needed
Simon Sapin <simon.sapin@octobus.net>
parents: 6117
diff changeset
52
5d1bfde39b95 topic: also make histedit clear the current topic if needed
Simon Sapin <simon.sapin@octobus.net>
parents: 6117
diff changeset
53 $ hg init repo2
5d1bfde39b95 topic: also make histedit clear the current topic if needed
Simon Sapin <simon.sapin@octobus.net>
parents: 6117
diff changeset
54 $ cd repo2
5d1bfde39b95 topic: also make histedit clear the current topic if needed
Simon Sapin <simon.sapin@octobus.net>
parents: 6117
diff changeset
55 $ hg topic topic1
5d1bfde39b95 topic: also make histedit clear the current topic if needed
Simon Sapin <simon.sapin@octobus.net>
parents: 6117
diff changeset
56 marked working directory as topic: topic1
5d1bfde39b95 topic: also make histedit clear the current topic if needed
Simon Sapin <simon.sapin@octobus.net>
parents: 6117
diff changeset
57 $ echo 1 > A
5d1bfde39b95 topic: also make histedit clear the current topic if needed
Simon Sapin <simon.sapin@octobus.net>
parents: 6117
diff changeset
58 $ hg ci -Aqm A
5d1bfde39b95 topic: also make histedit clear the current topic if needed
Simon Sapin <simon.sapin@octobus.net>
parents: 6117
diff changeset
59 $ hg topic --clear
5d1bfde39b95 topic: also make histedit clear the current topic if needed
Simon Sapin <simon.sapin@octobus.net>
parents: 6117
diff changeset
60 $ echo 1 > B
5d1bfde39b95 topic: also make histedit clear the current topic if needed
Simon Sapin <simon.sapin@octobus.net>
parents: 6117
diff changeset
61 $ hg ci -Aqm B
5d1bfde39b95 topic: also make histedit clear the current topic if needed
Simon Sapin <simon.sapin@octobus.net>
parents: 6117
diff changeset
62 $ echo 1 > C
5d1bfde39b95 topic: also make histedit clear the current topic if needed
Simon Sapin <simon.sapin@octobus.net>
parents: 6117
diff changeset
63 $ hg ci -Aqm C
5d1bfde39b95 topic: also make histedit clear the current topic if needed
Simon Sapin <simon.sapin@octobus.net>
parents: 6117
diff changeset
64 $ hg glog
5d1bfde39b95 topic: also make histedit clear the current topic if needed
Simon Sapin <simon.sapin@octobus.net>
parents: 6117
diff changeset
65 @ 2:c47acbb860b3 [] C
5d1bfde39b95 topic: also make histedit clear the current topic if needed
Simon Sapin <simon.sapin@octobus.net>
parents: 6117
diff changeset
66 |
5d1bfde39b95 topic: also make histedit clear the current topic if needed
Simon Sapin <simon.sapin@octobus.net>
parents: 6117
diff changeset
67 o 1:e2e2ca96a6bb [] B
5d1bfde39b95 topic: also make histedit clear the current topic if needed
Simon Sapin <simon.sapin@octobus.net>
parents: 6117
diff changeset
68 |
5d1bfde39b95 topic: also make histedit clear the current topic if needed
Simon Sapin <simon.sapin@octobus.net>
parents: 6117
diff changeset
69 o 0:c051488dac25 [topic1] A
5d1bfde39b95 topic: also make histedit clear the current topic if needed
Simon Sapin <simon.sapin@octobus.net>
parents: 6117
diff changeset
70
5d1bfde39b95 topic: also make histedit clear the current topic if needed
Simon Sapin <simon.sapin@octobus.net>
parents: 6117
diff changeset
71 Swap the order of commits B and C
5d1bfde39b95 topic: also make histedit clear the current topic if needed
Simon Sapin <simon.sapin@octobus.net>
parents: 6117
diff changeset
72
5d1bfde39b95 topic: also make histedit clear the current topic if needed
Simon Sapin <simon.sapin@octobus.net>
parents: 6117
diff changeset
73 $ hg histedit s1 -q --commands - 2>&1 << EOF
5d1bfde39b95 topic: also make histedit clear the current topic if needed
Simon Sapin <simon.sapin@octobus.net>
parents: 6117
diff changeset
74 > pick c47acbb860b3 C
5d1bfde39b95 topic: also make histedit clear the current topic if needed
Simon Sapin <simon.sapin@octobus.net>
parents: 6117
diff changeset
75 > pick e2e2ca96a6bb B
5d1bfde39b95 topic: also make histedit clear the current topic if needed
Simon Sapin <simon.sapin@octobus.net>
parents: 6117
diff changeset
76 > EOF
5d1bfde39b95 topic: also make histedit clear the current topic if needed
Simon Sapin <simon.sapin@octobus.net>
parents: 6117
diff changeset
77
5d1bfde39b95 topic: also make histedit clear the current topic if needed
Simon Sapin <simon.sapin@octobus.net>
parents: 6117
diff changeset
78 B and C still don't have a topic
5d1bfde39b95 topic: also make histedit clear the current topic if needed
Simon Sapin <simon.sapin@octobus.net>
parents: 6117
diff changeset
79
5d1bfde39b95 topic: also make histedit clear the current topic if needed
Simon Sapin <simon.sapin@octobus.net>
parents: 6117
diff changeset
80 $ hg glog
5d1bfde39b95 topic: also make histedit clear the current topic if needed
Simon Sapin <simon.sapin@octobus.net>
parents: 6117
diff changeset
81 @ 4:ff3439fe6f3d [] B
5d1bfde39b95 topic: also make histedit clear the current topic if needed
Simon Sapin <simon.sapin@octobus.net>
parents: 6117
diff changeset
82 |
5d1bfde39b95 topic: also make histedit clear the current topic if needed
Simon Sapin <simon.sapin@octobus.net>
parents: 6117
diff changeset
83 o 3:bb6fab1a29c6 [] C
5d1bfde39b95 topic: also make histedit clear the current topic if needed
Simon Sapin <simon.sapin@octobus.net>
parents: 6117
diff changeset
84 |
5d1bfde39b95 topic: also make histedit clear the current topic if needed
Simon Sapin <simon.sapin@octobus.net>
parents: 6117
diff changeset
85 o 0:c051488dac25 [topic1] A
5d1bfde39b95 topic: also make histedit clear the current topic if needed
Simon Sapin <simon.sapin@octobus.net>
parents: 6117
diff changeset
86
5d1bfde39b95 topic: also make histedit clear the current topic if needed
Simon Sapin <simon.sapin@octobus.net>
parents: 6117
diff changeset
87 $ cd ..
6119
b883fc38e07c tests: add a case for issue6550 where s0 has no topic
Anton Shestakov <av6@dwimlabs.net>
parents: 6118
diff changeset
88
b883fc38e07c tests: add a case for issue6550 where s0 has no topic
Anton Shestakov <av6@dwimlabs.net>
parents: 6118
diff changeset
89 Editing commits with a topic on top of a commit without a topic:
b883fc38e07c tests: add a case for issue6550 where s0 has no topic
Anton Shestakov <av6@dwimlabs.net>
parents: 6118
diff changeset
90
b883fc38e07c tests: add a case for issue6550 where s0 has no topic
Anton Shestakov <av6@dwimlabs.net>
parents: 6118
diff changeset
91 $ hg init repo3
b883fc38e07c tests: add a case for issue6550 where s0 has no topic
Anton Shestakov <av6@dwimlabs.net>
parents: 6118
diff changeset
92 $ cd repo3
b883fc38e07c tests: add a case for issue6550 where s0 has no topic
Anton Shestakov <av6@dwimlabs.net>
parents: 6118
diff changeset
93 $ echo 1 > A
b883fc38e07c tests: add a case for issue6550 where s0 has no topic
Anton Shestakov <av6@dwimlabs.net>
parents: 6118
diff changeset
94 $ hg ci -Aqm A
b883fc38e07c tests: add a case for issue6550 where s0 has no topic
Anton Shestakov <av6@dwimlabs.net>
parents: 6118
diff changeset
95 $ hg topic topic1
b883fc38e07c tests: add a case for issue6550 where s0 has no topic
Anton Shestakov <av6@dwimlabs.net>
parents: 6118
diff changeset
96 marked working directory as topic: topic1
b883fc38e07c tests: add a case for issue6550 where s0 has no topic
Anton Shestakov <av6@dwimlabs.net>
parents: 6118
diff changeset
97 $ echo 1 > B
b883fc38e07c tests: add a case for issue6550 where s0 has no topic
Anton Shestakov <av6@dwimlabs.net>
parents: 6118
diff changeset
98 $ hg ci -Aqm B
b883fc38e07c tests: add a case for issue6550 where s0 has no topic
Anton Shestakov <av6@dwimlabs.net>
parents: 6118
diff changeset
99 $ echo 1 > C
b883fc38e07c tests: add a case for issue6550 where s0 has no topic
Anton Shestakov <av6@dwimlabs.net>
parents: 6118
diff changeset
100 $ hg ci -Aqm C
b883fc38e07c tests: add a case for issue6550 where s0 has no topic
Anton Shestakov <av6@dwimlabs.net>
parents: 6118
diff changeset
101 $ hg glog
b883fc38e07c tests: add a case for issue6550 where s0 has no topic
Anton Shestakov <av6@dwimlabs.net>
parents: 6118
diff changeset
102 @ 2:c3dae6eda73b [topic1] C
b883fc38e07c tests: add a case for issue6550 where s0 has no topic
Anton Shestakov <av6@dwimlabs.net>
parents: 6118
diff changeset
103 |
b883fc38e07c tests: add a case for issue6550 where s0 has no topic
Anton Shestakov <av6@dwimlabs.net>
parents: 6118
diff changeset
104 o 1:db3a7c9052ac [topic1] B
b883fc38e07c tests: add a case for issue6550 where s0 has no topic
Anton Shestakov <av6@dwimlabs.net>
parents: 6118
diff changeset
105 |
b883fc38e07c tests: add a case for issue6550 where s0 has no topic
Anton Shestakov <av6@dwimlabs.net>
parents: 6118
diff changeset
106 o 0:a18fe624bf77 [] A
b883fc38e07c tests: add a case for issue6550 where s0 has no topic
Anton Shestakov <av6@dwimlabs.net>
parents: 6118
diff changeset
107
b883fc38e07c tests: add a case for issue6550 where s0 has no topic
Anton Shestakov <av6@dwimlabs.net>
parents: 6118
diff changeset
108 Swap the order of commits B and C
b883fc38e07c tests: add a case for issue6550 where s0 has no topic
Anton Shestakov <av6@dwimlabs.net>
parents: 6118
diff changeset
109
b883fc38e07c tests: add a case for issue6550 where s0 has no topic
Anton Shestakov <av6@dwimlabs.net>
parents: 6118
diff changeset
110 $ hg histedit s1 -q --commands - 2>&1 << EOF
b883fc38e07c tests: add a case for issue6550 where s0 has no topic
Anton Shestakov <av6@dwimlabs.net>
parents: 6118
diff changeset
111 > pick c3dae6eda73b C
b883fc38e07c tests: add a case for issue6550 where s0 has no topic
Anton Shestakov <av6@dwimlabs.net>
parents: 6118
diff changeset
112 > pick db3a7c9052ac B
b883fc38e07c tests: add a case for issue6550 where s0 has no topic
Anton Shestakov <av6@dwimlabs.net>
parents: 6118
diff changeset
113 > EOF
b883fc38e07c tests: add a case for issue6550 where s0 has no topic
Anton Shestakov <av6@dwimlabs.net>
parents: 6118
diff changeset
114
b883fc38e07c tests: add a case for issue6550 where s0 has no topic
Anton Shestakov <av6@dwimlabs.net>
parents: 6118
diff changeset
115 Topic of B and C is preserved
b883fc38e07c tests: add a case for issue6550 where s0 has no topic
Anton Shestakov <av6@dwimlabs.net>
parents: 6118
diff changeset
116
b883fc38e07c tests: add a case for issue6550 where s0 has no topic
Anton Shestakov <av6@dwimlabs.net>
parents: 6118
diff changeset
117 $ hg glog
b883fc38e07c tests: add a case for issue6550 where s0 has no topic
Anton Shestakov <av6@dwimlabs.net>
parents: 6118
diff changeset
118 @ 4:aa7af5cc1567 [topic1] B
b883fc38e07c tests: add a case for issue6550 where s0 has no topic
Anton Shestakov <av6@dwimlabs.net>
parents: 6118
diff changeset
119 |
b883fc38e07c tests: add a case for issue6550 where s0 has no topic
Anton Shestakov <av6@dwimlabs.net>
parents: 6118
diff changeset
120 o 3:4bf8cf7b2c73 [topic1] C
b883fc38e07c tests: add a case for issue6550 where s0 has no topic
Anton Shestakov <av6@dwimlabs.net>
parents: 6118
diff changeset
121 |
b883fc38e07c tests: add a case for issue6550 where s0 has no topic
Anton Shestakov <av6@dwimlabs.net>
parents: 6118
diff changeset
122 o 0:a18fe624bf77 [] A
b883fc38e07c tests: add a case for issue6550 where s0 has no topic
Anton Shestakov <av6@dwimlabs.net>
parents: 6118
diff changeset
123
b883fc38e07c tests: add a case for issue6550 where s0 has no topic
Anton Shestakov <av6@dwimlabs.net>
parents: 6118
diff changeset
124 $ cd ..