comparison tests/test-topic-issue6406.t @ 6654:968b9651b1f7 stable

tests: demonstrate hg pick currently ignoring active topic (issue6406)
author Anton Shestakov <av6@dwimlabs.net>
date Wed, 13 Dec 2023 15:44:30 -0300
parents
children 81fe0a498447
comparison
equal deleted inserted replaced
6653:a93758f6f937 6654:968b9651b1f7
1 hg pick with no active topic and with a different active topic (issue6406)
2 https://bz.mercurial-scm.org/show_bug.cgi?id=6406
3 For prior discussions on this behavior see also
4 https://foss.heptapod.net/mercurial/evolve/-/merge_requests/313
5 https://foss.heptapod.net/mercurial/evolve/-/merge_requests/390
6
7 $ . "$TESTDIR/testlib/common.sh"
8
9 $ cat << EOF >> "$HGRCPATH"
10 > [phases]
11 > publish = no
12 > [extensions]
13 > evolve =
14 > topic =
15 > EOF
16
17 #testcases inmemory ondisk
18 #if inmemory
19 $ cat >> $HGRCPATH <<EOF
20 > [experimental]
21 > evolution.in-memory = yes
22 > EOF
23 #endif
24
25 $ hg init issue6406
26 $ cd issue6406
27
28 $ mkcommit ROOT
29
30 $ hg debug-topic-namespace aaa
31 marked working directory as topic namespace: aaa
32 $ hg topic a-things
33 marked working directory as topic: a-things
34 $ mkcommit apple
35 active topic 'a-things' grew its first changeset
36 (see 'hg help topics' for more information)
37
38 $ hg up 'desc("ROOT")'
39 0 files updated, 0 files merged, 1 files removed, 0 files unresolved
40 $ hg debug-topic-namespace bbb
41 marked working directory as topic namespace: bbb
42 $ hg topic b-things
43 marked working directory as topic: b-things
44 $ mkcommit banana
45 active topic 'b-things' grew its first changeset
46 (see 'hg help topics' for more information)
47 $ mkcommit blackberry
48
49 $ hg up 'desc("apple")'
50 switching to topic-namespace aaa
51 switching to topic a-things
52 1 files updated, 0 files merged, 2 files removed, 0 files unresolved
53
54 This is what the help text says about this issue
55
56 $ hg help pick | grep 'active topic'
57 If there is an active topic, it will be used for the resulting changeset.
58
59 wdir has no active topic: pick should clear topic of the resulting cset
60
61 $ hg debug-topic-namespace --clear
62 $ hg topic --clear
63 $ hg pick 'desc("banana")'
64 picking 2:fcda3d8dafd2 "banana"
65 1 new orphan changesets
66 $ hg log -r . -T '{rev}: {desc} ({fqbn})\n'
67 4: banana (default//bbb/b-things) (known-bad-output !)
68 4: banana (default) (missing-correct-output !)
69 $ hg debug-topic-namespace
70 none
71 $ hg topic --current
72 no active topic
73 [1]
74
75 wdir has active topic: pick should use the active topic for the resulting cset
76
77 $ hg debug-topic-namespace everything
78 marked working directory as topic namespace: everything
79 $ hg topic all-things
80 marked working directory as topic: all-things
81 $ hg pick 'desc("blackberry")'
82 picking 3:48bbfbece8fa "blackberry"
83 active topic 'all-things' grew its first changeset (missing-correct-output !)
84 (see 'hg help topics' for more information) (missing-correct-output !)
85 $ hg log -r . -T '{rev}: {desc} ({fqbn})\n'
86 5: blackberry (default//bbb/b-things) (known-bad-output !)
87 5: blackberry (default//everything/all-things) (missing-correct-output !)
88 $ hg debug-topic-namespace
89 everything
90 $ hg topic --current
91 all-things
92
93 $ hg log -GT '{rev}: {desc} ({fqbn})\n{join(extras, " ")}\n\n'
94 @ 5: blackberry (default//bbb/b-things) (known-bad-output !)
95 | branch=default topic=b-things topic-namespace=bbb (known-bad-output !)
96 @ 5: blackberry (default//everything/all-things) (missing-correct-output !)
97 | branch=default topic=all-things topic-namespace=everything (missing-correct-output !)
98 |
99 o 4: banana (default//bbb/b-things) (known-bad-output !)
100 | branch=default topic=b-things topic-namespace=bbb (known-bad-output !)
101 o 4: banana (default) (missing-correct-output !)
102 | branch=default (missing-correct-output !)
103 |
104 o 1: apple (default//aaa/a-things)
105 | branch=default topic=a-things topic-namespace=aaa
106 |
107 o 0: ROOT (default)
108 branch=default
109