comparison tests/test-topic-issue6406.t @ 6655:81fe0a498447 stable

topic: internal config option to fix hg pick behavior (issue6406) After some consideration, hg pick was made to always use current topic (and topic namespace), even if it's not set, in which case the resulting changeset will not have any topic. Previously the intended behavior was to only update topic if there was an active topic, and not touch commit extras at all otherwise. That wasn't ideal, since pick doesn't change active topic, and amending the just-picked commit would unset its topic without clear user's intent to do so and to their surprise.
author Anton Shestakov <av6@dwimlabs.net>
date Sat, 27 Jan 2024 17:36:39 -0300
parents 968b9651b1f7
children 9da0114a8a02 195941260a67
comparison
equal deleted inserted replaced
6654:968b9651b1f7 6655:81fe0a498447
52 1 files updated, 0 files merged, 2 files removed, 0 files unresolved 52 1 files updated, 0 files merged, 2 files removed, 0 files unresolved
53 53
54 This is what the help text says about this issue 54 This is what the help text says about this issue
55 55
56 $ hg help pick | grep 'active topic' 56 $ hg help pick | grep 'active topic'
57 If there is an active topic, it will be used for the resulting changeset. 57 The resulting changeset will have the current active topic. If there's no
58 active topic set, the resulting changeset will also not have any topic.
58 59
59 wdir has no active topic: pick should clear topic of the resulting cset 60 wdir has no active topic: pick should clear topic of the resulting cset
60 61
61 $ hg debug-topic-namespace --clear 62 $ hg debug-topic-namespace --clear
62 $ hg topic --clear 63 $ hg topic --clear
63 $ hg pick 'desc("banana")' 64 $ hg pick 'desc("banana")'
64 picking 2:fcda3d8dafd2 "banana" 65 picking 2:fcda3d8dafd2 "banana"
65 1 new orphan changesets 66 1 new orphan changesets
66 $ hg log -r . -T '{rev}: {desc} ({fqbn})\n' 67 $ hg log -r . -T '{rev}: {desc} ({fqbn})\n'
67 4: banana (default//bbb/b-things) (known-bad-output !) 68 4: banana (default)
68 4: banana (default) (missing-correct-output !)
69 $ hg debug-topic-namespace 69 $ hg debug-topic-namespace
70 none 70 none
71 $ hg topic --current 71 $ hg topic --current
72 no active topic 72 no active topic
73 [1] 73 [1]
78 marked working directory as topic namespace: everything 78 marked working directory as topic namespace: everything
79 $ hg topic all-things 79 $ hg topic all-things
80 marked working directory as topic: all-things 80 marked working directory as topic: all-things
81 $ hg pick 'desc("blackberry")' 81 $ hg pick 'desc("blackberry")'
82 picking 3:48bbfbece8fa "blackberry" 82 picking 3:48bbfbece8fa "blackberry"
83 active topic 'all-things' grew its first changeset (missing-correct-output !) 83 active topic 'all-things' grew its first changeset
84 (see 'hg help topics' for more information) (missing-correct-output !) 84 (see 'hg help topics' for more information)
85 $ hg log -r . -T '{rev}: {desc} ({fqbn})\n' 85 $ hg log -r . -T '{rev}: {desc} ({fqbn})\n'
86 5: blackberry (default//bbb/b-things) (known-bad-output !) 86 5: blackberry (default//everything/all-things)
87 5: blackberry (default//everything/all-things) (missing-correct-output !)
88 $ hg debug-topic-namespace 87 $ hg debug-topic-namespace
89 everything 88 everything
90 $ hg topic --current 89 $ hg topic --current
91 all-things 90 all-things
92 91
93 $ hg log -GT '{rev}: {desc} ({fqbn})\n{join(extras, " ")}\n\n' 92 $ hg log -GT '{rev}: {desc} ({fqbn})\n{join(extras, " ")}\n\n'
94 @ 5: blackberry (default//bbb/b-things) (known-bad-output !) 93 @ 5: blackberry (default//everything/all-things)
95 | branch=default topic=b-things topic-namespace=bbb (known-bad-output !) 94 | branch=default topic=all-things topic-namespace=everything
96 @ 5: blackberry (default//everything/all-things) (missing-correct-output !)
97 | branch=default topic=all-things topic-namespace=everything (missing-correct-output !)
98 | 95 |
99 o 4: banana (default//bbb/b-things) (known-bad-output !) 96 o 4: banana (default)
100 | branch=default topic=b-things topic-namespace=bbb (known-bad-output !) 97 | branch=default
101 o 4: banana (default) (missing-correct-output !)
102 | branch=default (missing-correct-output !)
103 | 98 |
104 o 1: apple (default//aaa/a-things) 99 o 1: apple (default//aaa/a-things)
105 | branch=default topic=a-things topic-namespace=aaa 100 | branch=default topic=a-things topic-namespace=aaa
106 | 101 |
107 o 0: ROOT (default) 102 o 0: ROOT (default)