comparison tests/test-namespaces.t @ 6690:6c653a3160ff mercurial-5.3

test-compat: merge mercurial-5.4 into mercurial-5.3
author Anton Shestakov <av6@dwimlabs.net>
date Sun, 04 Feb 2024 20:40:31 -0300
parents e2fbec28654c
children 5376963ea1d9
comparison
equal deleted inserted replaced
6588:3194a80b96d3 6690:6c653a3160ff
9 9
10 $ hg debug-topic-namespace space-name 10 $ hg debug-topic-namespace space-name
11 marked working directory as topic namespace: space-name 11 marked working directory as topic namespace: space-name
12 $ hg debug-topic-namespaces 12 $ hg debug-topic-namespaces
13 space-name 13 space-name
14 $ cat .hg/topic-namespace
15 space-name (no-eol)
14 16
15 $ hg log -r 'wdir()' -T '{topic_namespace}\n' 17 $ hg log -r 'wdir()' -T '{topic_namespace}\n'
16 none 18 none
17 19
18 $ hg log -r 'wdir()' -T '{fqbn}\n' 20 $ hg log -r 'wdir()' -T '{fqbn}\n'
28 $ hg log -r 'wdir()' -T '{topic_namespace}\n' 30 $ hg log -r 'wdir()' -T '{topic_namespace}\n'
29 space-name 31 space-name
30 32
31 $ hg log -r 'wdir()' -T '{fqbn}\n' 33 $ hg log -r 'wdir()' -T '{fqbn}\n'
32 default//space-name/feature 34 default//space-name/feature
35
36 Non-ascii topic namespace name
37
38 $ hg debug-topic-namespace --clear
39 $ test -f .hg/topic-namespace
40 [1]
41 $ hg --encoding utf-8 debug-topic-namespace æ
42 marked working directory as topic namespace: \xc3\xa6 (esc)
43 $ hg --encoding utf-8 debug-topic-namespaces
44 \xc3\xa6 (esc)
45 $ hg --encoding ascii debug-topic-namespaces
46 ? (esc)
47 $ hg --encoding latin1 debug-topic-namespaces
48 \xe6 (esc)
49 $ cat .hg/topic-namespace
50 \xc3\xa6 (no-eol) (esc)
51
52 $ hg --encoding utf-8 debug-topic-namespace ©
53 abort: invalid topic namespace name: '\xc2\xa9' (esc)
54 (topic namespace names can only consist of alphanumeric, '-', '_' and '.' characters)
55 [255]
56
57 $ hg --encoding latin1 debug-topic-namespace æ
58 abort: invalid topic namespace name: '\xc3\xa6' (esc)
59 (topic namespace names can only consist of alphanumeric, '-', '_' and '.' characters)
60 [255]
33 61
34 $ hg branches 62 $ hg branches
35 63
36 $ hg debug-topic-namespace --clear 64 $ hg debug-topic-namespace --clear
37 $ hg debug-topic-namespaces 65 $ hg debug-topic-namespaces
61 0: stable alice feature 89 0: stable alice feature
62 90
63 $ hg log -r . -T '{rev}: {fqbn}\n' 91 $ hg log -r . -T '{rev}: {fqbn}\n'
64 0: stable//alice/feature 92 0: stable//alice/feature
65 93
94 $ hg log -r . -T '{rev}: {join(extras, " ")}\n'
95 0: branch=stable topic=feature topic-namespace=alice
96
66 $ hg branches 97 $ hg branches
67 stable//alice/feature 0:69c7dbf6acd1 98 stable//alice/feature 0:69c7dbf6acd1
99
100 Removing topic namespace file if it contains the default value
101
102 The default value changed from b'default' to b'none' in 11.1.0, this is a
103 safeguard against accidentally putting the new default tns value into commit
104 extras with an old version of topic extension
105
106 $ printf 'none' > .hg/topic-namespace
107 $ test -f .hg/topic-namespace
108 $ hg ci -m ''
109 nothing changed
110 [1]
111 $ test -f .hg/topic-namespace
112 [1]
68 113
69 Updating to a revision with a namespace should activate it 114 Updating to a revision with a namespace should activate it
70 115
71 $ hg up null 116 $ hg up null
72 0 files updated, 0 files merged, 1 files removed, 0 files unresolved 117 0 files updated, 0 files merged, 1 files removed, 0 files unresolved
73 $ hg debug-topic-namespace 118 $ hg debug-topic-namespace
74 none 119 none
120 $ test -f .hg/topic-namespace
121 [1]
75 $ hg topics 122 $ hg topics
76 feature (1 changesets) 123 feature (1 changesets)
124 $ test -f .hg/topic
125 [1]
77 $ hg up 0 126 $ hg up 0
78 switching to topic-namespace alice 127 switching to topic-namespace alice
79 switching to topic feature 128 switching to topic feature
80 1 files updated, 0 files merged, 0 files removed, 0 files unresolved 129 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
81 $ hg debug-topic-namespace 130 $ hg debug-topic-namespace
82 alice 131 alice
132 $ cat .hg/topic-namespace
133 alice (no-eol)
83 $ hg topics 134 $ hg topics
84 * feature (1 changesets) 135 * feature (1 changesets)
136 $ cat .hg/topic
137 feature (no-eol)
85 138
86 Updating to a topic namespace is not supported 139 Updating to a topic namespace is not supported
87 140
88 $ hg up alice 141 $ hg up alice
89 abort: unknown revision 'alice'! 142 abort: unknown revision 'alice'!