annotate tests/test-namespaces.t @ 6536:90b631fde2d7 stable

topic: only set topic on workingcommitctx if it doesn't already have one This fix is so obvious, that I wonder, if this is the correct thing to do, why wasn't it done like this from the beginning. Despite my doubts, all the tests pass.
author Anton Shestakov <av6@dwimlabs.net>
date Mon, 17 Jul 2023 15:52:39 -0300
parents 43166bd57d6c
children ca1c219bd59f
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
6236
7ad8107d953a topic: introduce topic namespaces concept starting with simple parsing
Anton Shestakov <av6@dwimlabs.net>
parents:
diff changeset
1 https://www.mercurial-scm.org/wiki/TopicPlan#sub_branches.2C_namespacing_and_representation
7ad8107d953a topic: introduce topic namespaces concept starting with simple parsing
Anton Shestakov <av6@dwimlabs.net>
parents:
diff changeset
2
7ad8107d953a topic: introduce topic namespaces concept starting with simple parsing
Anton Shestakov <av6@dwimlabs.net>
parents:
diff changeset
3 $ . "$TESTDIR/testlib/topic_setup.sh"
7ad8107d953a topic: introduce topic namespaces concept starting with simple parsing
Anton Shestakov <av6@dwimlabs.net>
parents:
diff changeset
4
6238
6bbd16579f0f topic: list namespaces with debug-namespaces
Anton Shestakov <av6@dwimlabs.net>
parents: 6237
diff changeset
5 $ hg init repo
6bbd16579f0f topic: list namespaces with debug-namespaces
Anton Shestakov <av6@dwimlabs.net>
parents: 6237
diff changeset
6 $ cd repo
6bbd16579f0f topic: list namespaces with debug-namespaces
Anton Shestakov <av6@dwimlabs.net>
parents: 6237
diff changeset
7
6239
8861e33f3bb2 topic: setting current repo namespace with debug-namespace
Anton Shestakov <av6@dwimlabs.net>
parents: 6238
diff changeset
8 $ hg debug-topic-namespace space-name
8861e33f3bb2 topic: setting current repo namespace with debug-namespace
Anton Shestakov <av6@dwimlabs.net>
parents: 6238
diff changeset
9 marked working directory as topic namespace: space-name
8861e33f3bb2 topic: setting current repo namespace with debug-namespace
Anton Shestakov <av6@dwimlabs.net>
parents: 6238
diff changeset
10 $ hg debug-topic-namespaces
8861e33f3bb2 topic: setting current repo namespace with debug-namespace
Anton Shestakov <av6@dwimlabs.net>
parents: 6238
diff changeset
11 space-name
8861e33f3bb2 topic: setting current repo namespace with debug-namespace
Anton Shestakov <av6@dwimlabs.net>
parents: 6238
diff changeset
12
6241
85abf58c3d8c topic: namespace template keyword
Anton Shestakov <av6@dwimlabs.net>
parents: 6240
diff changeset
13 $ hg log -r 'wdir()' -T '{topic_namespace}\n'
85abf58c3d8c topic: namespace template keyword
Anton Shestakov <av6@dwimlabs.net>
parents: 6240
diff changeset
14 space-name
85abf58c3d8c topic: namespace template keyword
Anton Shestakov <av6@dwimlabs.net>
parents: 6240
diff changeset
15
6243
91d9a279b84a topic: fqbn template keyword
Anton Shestakov <av6@dwimlabs.net>
parents: 6241
diff changeset
16 $ hg log -r 'wdir()' -T '{fqbn}\n'
91d9a279b84a topic: fqbn template keyword
Anton Shestakov <av6@dwimlabs.net>
parents: 6241
diff changeset
17 default//space-name/
91d9a279b84a topic: fqbn template keyword
Anton Shestakov <av6@dwimlabs.net>
parents: 6241
diff changeset
18
6239
8861e33f3bb2 topic: setting current repo namespace with debug-namespace
Anton Shestakov <av6@dwimlabs.net>
parents: 6238
diff changeset
19 $ hg branches
8861e33f3bb2 topic: setting current repo namespace with debug-namespace
Anton Shestakov <av6@dwimlabs.net>
parents: 6238
diff changeset
20
8861e33f3bb2 topic: setting current repo namespace with debug-namespace
Anton Shestakov <av6@dwimlabs.net>
parents: 6238
diff changeset
21 $ hg debug-topic-namespace --clear
6238
6bbd16579f0f topic: list namespaces with debug-namespaces
Anton Shestakov <av6@dwimlabs.net>
parents: 6237
diff changeset
22 $ hg debug-topic-namespaces
6bbd16579f0f topic: list namespaces with debug-namespaces
Anton Shestakov <av6@dwimlabs.net>
parents: 6237
diff changeset
23 default
6bbd16579f0f topic: list namespaces with debug-namespaces
Anton Shestakov <av6@dwimlabs.net>
parents: 6237
diff changeset
24
6239
8861e33f3bb2 topic: setting current repo namespace with debug-namespace
Anton Shestakov <av6@dwimlabs.net>
parents: 6238
diff changeset
25 $ hg debugtopicnamespace --clear nonsense
8861e33f3bb2 topic: setting current repo namespace with debug-namespace
Anton Shestakov <av6@dwimlabs.net>
parents: 6238
diff changeset
26 abort: cannot use --clear when setting a topic namespace
8861e33f3bb2 topic: setting current repo namespace with debug-namespace
Anton Shestakov <av6@dwimlabs.net>
parents: 6238
diff changeset
27 [255]
8861e33f3bb2 topic: setting current repo namespace with debug-namespace
Anton Shestakov <av6@dwimlabs.net>
parents: 6238
diff changeset
28
6240
2686ecc90791 topic: store topic namespace in commit extras
Anton Shestakov <av6@dwimlabs.net>
parents: 6239
diff changeset
29 $ hg branch stable
2686ecc90791 topic: store topic namespace in commit extras
Anton Shestakov <av6@dwimlabs.net>
parents: 6239
diff changeset
30 marked working directory as branch stable
2686ecc90791 topic: store topic namespace in commit extras
Anton Shestakov <av6@dwimlabs.net>
parents: 6239
diff changeset
31 (branches are permanent and global, did you want a bookmark?)
2686ecc90791 topic: store topic namespace in commit extras
Anton Shestakov <av6@dwimlabs.net>
parents: 6239
diff changeset
32 $ hg debug-topic-namespace alice
2686ecc90791 topic: store topic namespace in commit extras
Anton Shestakov <av6@dwimlabs.net>
parents: 6239
diff changeset
33 marked working directory as topic namespace: alice
2686ecc90791 topic: store topic namespace in commit extras
Anton Shestakov <av6@dwimlabs.net>
parents: 6239
diff changeset
34 $ hg topic feature
2686ecc90791 topic: store topic namespace in commit extras
Anton Shestakov <av6@dwimlabs.net>
parents: 6239
diff changeset
35 marked working directory as topic: feature
2686ecc90791 topic: store topic namespace in commit extras
Anton Shestakov <av6@dwimlabs.net>
parents: 6239
diff changeset
36 $ echo a > a
2686ecc90791 topic: store topic namespace in commit extras
Anton Shestakov <av6@dwimlabs.net>
parents: 6239
diff changeset
37 $ hg ci -qAm a
2686ecc90791 topic: store topic namespace in commit extras
Anton Shestakov <av6@dwimlabs.net>
parents: 6239
diff changeset
38
2686ecc90791 topic: store topic namespace in commit extras
Anton Shestakov <av6@dwimlabs.net>
parents: 6239
diff changeset
39 $ hg debug-topic-namespaces
2686ecc90791 topic: store topic namespace in commit extras
Anton Shestakov <av6@dwimlabs.net>
parents: 6239
diff changeset
40 alice
2686ecc90791 topic: store topic namespace in commit extras
Anton Shestakov <av6@dwimlabs.net>
parents: 6239
diff changeset
41
6241
85abf58c3d8c topic: namespace template keyword
Anton Shestakov <av6@dwimlabs.net>
parents: 6240
diff changeset
42 $ hg log -r . -T '{rev}: {branch} {topic_namespace} {topic}\n'
85abf58c3d8c topic: namespace template keyword
Anton Shestakov <av6@dwimlabs.net>
parents: 6240
diff changeset
43 0: stable alice feature
85abf58c3d8c topic: namespace template keyword
Anton Shestakov <av6@dwimlabs.net>
parents: 6240
diff changeset
44
6243
91d9a279b84a topic: fqbn template keyword
Anton Shestakov <av6@dwimlabs.net>
parents: 6241
diff changeset
45 $ hg log -r . -T '{rev}: {fqbn}\n'
91d9a279b84a topic: fqbn template keyword
Anton Shestakov <av6@dwimlabs.net>
parents: 6241
diff changeset
46 0: stable//alice/feature
91d9a279b84a topic: fqbn template keyword
Anton Shestakov <av6@dwimlabs.net>
parents: 6241
diff changeset
47
6271
caf302fb8f4d topic: use branch//namespace/topic format everywhere except exchange
Anton Shestakov <av6@dwimlabs.net>
parents: 6267
diff changeset
48 $ hg branches
caf302fb8f4d topic: use branch//namespace/topic format everywhere except exchange
Anton Shestakov <av6@dwimlabs.net>
parents: 6267
diff changeset
49 stable//alice/feature 0:69c7dbf6acd1
caf302fb8f4d topic: use branch//namespace/topic format everywhere except exchange
Anton Shestakov <av6@dwimlabs.net>
parents: 6267
diff changeset
50
6245
a54db3e55c88 topic: switch to namespace when updating to a commit, similar to topic
Anton Shestakov <av6@dwimlabs.net>
parents: 6243
diff changeset
51 Updating to a revision with a namespace should activate it
a54db3e55c88 topic: switch to namespace when updating to a commit, similar to topic
Anton Shestakov <av6@dwimlabs.net>
parents: 6243
diff changeset
52
a54db3e55c88 topic: switch to namespace when updating to a commit, similar to topic
Anton Shestakov <av6@dwimlabs.net>
parents: 6243
diff changeset
53 $ hg up null
a54db3e55c88 topic: switch to namespace when updating to a commit, similar to topic
Anton Shestakov <av6@dwimlabs.net>
parents: 6243
diff changeset
54 0 files updated, 0 files merged, 1 files removed, 0 files unresolved
a54db3e55c88 topic: switch to namespace when updating to a commit, similar to topic
Anton Shestakov <av6@dwimlabs.net>
parents: 6243
diff changeset
55 $ hg debug-topic-namespace
a54db3e55c88 topic: switch to namespace when updating to a commit, similar to topic
Anton Shestakov <av6@dwimlabs.net>
parents: 6243
diff changeset
56 default
a54db3e55c88 topic: switch to namespace when updating to a commit, similar to topic
Anton Shestakov <av6@dwimlabs.net>
parents: 6243
diff changeset
57 $ hg topics
a54db3e55c88 topic: switch to namespace when updating to a commit, similar to topic
Anton Shestakov <av6@dwimlabs.net>
parents: 6243
diff changeset
58 feature (1 changesets)
a54db3e55c88 topic: switch to namespace when updating to a commit, similar to topic
Anton Shestakov <av6@dwimlabs.net>
parents: 6243
diff changeset
59 $ hg up 0
a54db3e55c88 topic: switch to namespace when updating to a commit, similar to topic
Anton Shestakov <av6@dwimlabs.net>
parents: 6243
diff changeset
60 switching to topic-namespace alice
a54db3e55c88 topic: switch to namespace when updating to a commit, similar to topic
Anton Shestakov <av6@dwimlabs.net>
parents: 6243
diff changeset
61 switching to topic feature
a54db3e55c88 topic: switch to namespace when updating to a commit, similar to topic
Anton Shestakov <av6@dwimlabs.net>
parents: 6243
diff changeset
62 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
a54db3e55c88 topic: switch to namespace when updating to a commit, similar to topic
Anton Shestakov <av6@dwimlabs.net>
parents: 6243
diff changeset
63 $ hg debug-topic-namespace
a54db3e55c88 topic: switch to namespace when updating to a commit, similar to topic
Anton Shestakov <av6@dwimlabs.net>
parents: 6243
diff changeset
64 alice
a54db3e55c88 topic: switch to namespace when updating to a commit, similar to topic
Anton Shestakov <av6@dwimlabs.net>
parents: 6243
diff changeset
65 $ hg topics
a54db3e55c88 topic: switch to namespace when updating to a commit, similar to topic
Anton Shestakov <av6@dwimlabs.net>
parents: 6243
diff changeset
66 * feature (1 changesets)
a54db3e55c88 topic: switch to namespace when updating to a commit, similar to topic
Anton Shestakov <av6@dwimlabs.net>
parents: 6243
diff changeset
67
6310
43166bd57d6c tests: addressing topic namespaces by name alone is not supported
Anton Shestakov <av6@dwimlabs.net>
parents: 6271
diff changeset
68 Updating to a topic namespace is not supported
43166bd57d6c tests: addressing topic namespaces by name alone is not supported
Anton Shestakov <av6@dwimlabs.net>
parents: 6271
diff changeset
69
43166bd57d6c tests: addressing topic namespaces by name alone is not supported
Anton Shestakov <av6@dwimlabs.net>
parents: 6271
diff changeset
70 $ hg up alice
43166bd57d6c tests: addressing topic namespaces by name alone is not supported
Anton Shestakov <av6@dwimlabs.net>
parents: 6271
diff changeset
71 abort: unknown revision 'alice'
43166bd57d6c tests: addressing topic namespaces by name alone is not supported
Anton Shestakov <av6@dwimlabs.net>
parents: 6271
diff changeset
72 [10]
43166bd57d6c tests: addressing topic namespaces by name alone is not supported
Anton Shestakov <av6@dwimlabs.net>
parents: 6271
diff changeset
73
6536
90b631fde2d7 topic: only set topic on workingcommitctx if it doesn't already have one
Anton Shestakov <av6@dwimlabs.net>
parents: 6310
diff changeset
74 Export/import of topic namespaces
90b631fde2d7 topic: only set topic on workingcommitctx if it doesn't already have one
Anton Shestakov <av6@dwimlabs.net>
parents: 6310
diff changeset
75
90b631fde2d7 topic: only set topic on workingcommitctx if it doesn't already have one
Anton Shestakov <av6@dwimlabs.net>
parents: 6310
diff changeset
76 $ hg export
90b631fde2d7 topic: only set topic on workingcommitctx if it doesn't already have one
Anton Shestakov <av6@dwimlabs.net>
parents: 6310
diff changeset
77 # HG changeset patch
90b631fde2d7 topic: only set topic on workingcommitctx if it doesn't already have one
Anton Shestakov <av6@dwimlabs.net>
parents: 6310
diff changeset
78 # User test
90b631fde2d7 topic: only set topic on workingcommitctx if it doesn't already have one
Anton Shestakov <av6@dwimlabs.net>
parents: 6310
diff changeset
79 # Date 0 0
90b631fde2d7 topic: only set topic on workingcommitctx if it doesn't already have one
Anton Shestakov <av6@dwimlabs.net>
parents: 6310
diff changeset
80 # Thu Jan 01 00:00:00 1970 +0000
90b631fde2d7 topic: only set topic on workingcommitctx if it doesn't already have one
Anton Shestakov <av6@dwimlabs.net>
parents: 6310
diff changeset
81 # Branch stable
90b631fde2d7 topic: only set topic on workingcommitctx if it doesn't already have one
Anton Shestakov <av6@dwimlabs.net>
parents: 6310
diff changeset
82 # Node ID 69c7dbf6acd180eeec055dd67933badd3601d45f
90b631fde2d7 topic: only set topic on workingcommitctx if it doesn't already have one
Anton Shestakov <av6@dwimlabs.net>
parents: 6310
diff changeset
83 # Parent 0000000000000000000000000000000000000000
90b631fde2d7 topic: only set topic on workingcommitctx if it doesn't already have one
Anton Shestakov <av6@dwimlabs.net>
parents: 6310
diff changeset
84 # EXP-Topic feature
90b631fde2d7 topic: only set topic on workingcommitctx if it doesn't already have one
Anton Shestakov <av6@dwimlabs.net>
parents: 6310
diff changeset
85 a
90b631fde2d7 topic: only set topic on workingcommitctx if it doesn't already have one
Anton Shestakov <av6@dwimlabs.net>
parents: 6310
diff changeset
86
90b631fde2d7 topic: only set topic on workingcommitctx if it doesn't already have one
Anton Shestakov <av6@dwimlabs.net>
parents: 6310
diff changeset
87 diff -r 000000000000 -r 69c7dbf6acd1 a
90b631fde2d7 topic: only set topic on workingcommitctx if it doesn't already have one
Anton Shestakov <av6@dwimlabs.net>
parents: 6310
diff changeset
88 --- /dev/null Thu Jan 01 00:00:00 1970 +0000
90b631fde2d7 topic: only set topic on workingcommitctx if it doesn't already have one
Anton Shestakov <av6@dwimlabs.net>
parents: 6310
diff changeset
89 +++ b/a Thu Jan 01 00:00:00 1970 +0000
90b631fde2d7 topic: only set topic on workingcommitctx if it doesn't already have one
Anton Shestakov <av6@dwimlabs.net>
parents: 6310
diff changeset
90 @@ -0,0 +1,1 @@
90b631fde2d7 topic: only set topic on workingcommitctx if it doesn't already have one
Anton Shestakov <av6@dwimlabs.net>
parents: 6310
diff changeset
91 +a
90b631fde2d7 topic: only set topic on workingcommitctx if it doesn't already have one
Anton Shestakov <av6@dwimlabs.net>
parents: 6310
diff changeset
92
90b631fde2d7 topic: only set topic on workingcommitctx if it doesn't already have one
Anton Shestakov <av6@dwimlabs.net>
parents: 6310
diff changeset
93 $ hg import - << EOF
90b631fde2d7 topic: only set topic on workingcommitctx if it doesn't already have one
Anton Shestakov <av6@dwimlabs.net>
parents: 6310
diff changeset
94 > # HG changeset patch
90b631fde2d7 topic: only set topic on workingcommitctx if it doesn't already have one
Anton Shestakov <av6@dwimlabs.net>
parents: 6310
diff changeset
95 > # User test
90b631fde2d7 topic: only set topic on workingcommitctx if it doesn't already have one
Anton Shestakov <av6@dwimlabs.net>
parents: 6310
diff changeset
96 > # Date 0 0
90b631fde2d7 topic: only set topic on workingcommitctx if it doesn't already have one
Anton Shestakov <av6@dwimlabs.net>
parents: 6310
diff changeset
97 > # Thu Jan 01 00:00:00 1970 +0000
90b631fde2d7 topic: only set topic on workingcommitctx if it doesn't already have one
Anton Shestakov <av6@dwimlabs.net>
parents: 6310
diff changeset
98 > # Branch another-branch
90b631fde2d7 topic: only set topic on workingcommitctx if it doesn't already have one
Anton Shestakov <av6@dwimlabs.net>
parents: 6310
diff changeset
99 > # Node ID 94981e5d988ea23cf2b17f6c07c39edc0f174b01
90b631fde2d7 topic: only set topic on workingcommitctx if it doesn't already have one
Anton Shestakov <av6@dwimlabs.net>
parents: 6310
diff changeset
100 > # Parent d6d47657e765570283ec03fc68836d9eb297c4b3
90b631fde2d7 topic: only set topic on workingcommitctx if it doesn't already have one
Anton Shestakov <av6@dwimlabs.net>
parents: 6310
diff changeset
101 > # EXP-Topic mytopic
90b631fde2d7 topic: only set topic on workingcommitctx if it doesn't already have one
Anton Shestakov <av6@dwimlabs.net>
parents: 6310
diff changeset
102 > added z
90b631fde2d7 topic: only set topic on workingcommitctx if it doesn't already have one
Anton Shestakov <av6@dwimlabs.net>
parents: 6310
diff changeset
103 >
90b631fde2d7 topic: only set topic on workingcommitctx if it doesn't already have one
Anton Shestakov <av6@dwimlabs.net>
parents: 6310
diff changeset
104 > diff --git a/z b/z
90b631fde2d7 topic: only set topic on workingcommitctx if it doesn't already have one
Anton Shestakov <av6@dwimlabs.net>
parents: 6310
diff changeset
105 > new file mode 100644
90b631fde2d7 topic: only set topic on workingcommitctx if it doesn't already have one
Anton Shestakov <av6@dwimlabs.net>
parents: 6310
diff changeset
106 > --- /dev/null
90b631fde2d7 topic: only set topic on workingcommitctx if it doesn't already have one
Anton Shestakov <av6@dwimlabs.net>
parents: 6310
diff changeset
107 > +++ b/z
90b631fde2d7 topic: only set topic on workingcommitctx if it doesn't already have one
Anton Shestakov <av6@dwimlabs.net>
parents: 6310
diff changeset
108 > @@ -0,0 +1,1 @@
90b631fde2d7 topic: only set topic on workingcommitctx if it doesn't already have one
Anton Shestakov <av6@dwimlabs.net>
parents: 6310
diff changeset
109 > +z
90b631fde2d7 topic: only set topic on workingcommitctx if it doesn't already have one
Anton Shestakov <av6@dwimlabs.net>
parents: 6310
diff changeset
110 > EOF
90b631fde2d7 topic: only set topic on workingcommitctx if it doesn't already have one
Anton Shestakov <av6@dwimlabs.net>
parents: 6310
diff changeset
111 applying patch from stdin
90b631fde2d7 topic: only set topic on workingcommitctx if it doesn't already have one
Anton Shestakov <av6@dwimlabs.net>
parents: 6310
diff changeset
112
90b631fde2d7 topic: only set topic on workingcommitctx if it doesn't already have one
Anton Shestakov <av6@dwimlabs.net>
parents: 6310
diff changeset
113 $ hg log -r tip -T '{rev}: {branch} {topic_namespace} {topic}\n'
90b631fde2d7 topic: only set topic on workingcommitctx if it doesn't already have one
Anton Shestakov <av6@dwimlabs.net>
parents: 6310
diff changeset
114 1: stable alice mytopic
90b631fde2d7 topic: only set topic on workingcommitctx if it doesn't already have one
Anton Shestakov <av6@dwimlabs.net>
parents: 6310
diff changeset
115
90b631fde2d7 topic: only set topic on workingcommitctx if it doesn't already have one
Anton Shestakov <av6@dwimlabs.net>
parents: 6310
diff changeset
116 $ hg log -r tip -T '{rev}: {fqbn}\n'
90b631fde2d7 topic: only set topic on workingcommitctx if it doesn't already have one
Anton Shestakov <av6@dwimlabs.net>
parents: 6310
diff changeset
117 1: stable//alice/mytopic
90b631fde2d7 topic: only set topic on workingcommitctx if it doesn't already have one
Anton Shestakov <av6@dwimlabs.net>
parents: 6310
diff changeset
118
6261
a2491c578d2b topic: namespace revset predicate
Anton Shestakov <av6@dwimlabs.net>
parents: 6245
diff changeset
119 Revsets
a2491c578d2b topic: namespace revset predicate
Anton Shestakov <av6@dwimlabs.net>
parents: 6245
diff changeset
120
a2491c578d2b topic: namespace revset predicate
Anton Shestakov <av6@dwimlabs.net>
parents: 6245
diff changeset
121 $ nslog() {
a2491c578d2b topic: namespace revset predicate
Anton Shestakov <av6@dwimlabs.net>
parents: 6245
diff changeset
122 > hg log -T '{rev}: {topic_namespace}\n' -r "$1"
a2491c578d2b topic: namespace revset predicate
Anton Shestakov <av6@dwimlabs.net>
parents: 6245
diff changeset
123 > }
a2491c578d2b topic: namespace revset predicate
Anton Shestakov <av6@dwimlabs.net>
parents: 6245
diff changeset
124
a2491c578d2b topic: namespace revset predicate
Anton Shestakov <av6@dwimlabs.net>
parents: 6245
diff changeset
125 $ nslog 'topicnamespace(:)'
a2491c578d2b topic: namespace revset predicate
Anton Shestakov <av6@dwimlabs.net>
parents: 6245
diff changeset
126 0: alice
6536
90b631fde2d7 topic: only set topic on workingcommitctx if it doesn't already have one
Anton Shestakov <av6@dwimlabs.net>
parents: 6310
diff changeset
127 1: alice
6261
a2491c578d2b topic: namespace revset predicate
Anton Shestakov <av6@dwimlabs.net>
parents: 6245
diff changeset
128 $ nslog 'topicnamespace(all())'
a2491c578d2b topic: namespace revset predicate
Anton Shestakov <av6@dwimlabs.net>
parents: 6245
diff changeset
129 0: alice
6536
90b631fde2d7 topic: only set topic on workingcommitctx if it doesn't already have one
Anton Shestakov <av6@dwimlabs.net>
parents: 6310
diff changeset
130 1: alice
6261
a2491c578d2b topic: namespace revset predicate
Anton Shestakov <av6@dwimlabs.net>
parents: 6245
diff changeset
131 $ nslog 'topicnamespace(topicnamespace("alice"))'
a2491c578d2b topic: namespace revset predicate
Anton Shestakov <av6@dwimlabs.net>
parents: 6245
diff changeset
132 0: alice
6536
90b631fde2d7 topic: only set topic on workingcommitctx if it doesn't already have one
Anton Shestakov <av6@dwimlabs.net>
parents: 6310
diff changeset
133 1: alice
6261
a2491c578d2b topic: namespace revset predicate
Anton Shestakov <av6@dwimlabs.net>
parents: 6245
diff changeset
134 $ nslog 'topicnamespace(wdir())'
a2491c578d2b topic: namespace revset predicate
Anton Shestakov <av6@dwimlabs.net>
parents: 6245
diff changeset
135 0: alice
6536
90b631fde2d7 topic: only set topic on workingcommitctx if it doesn't already have one
Anton Shestakov <av6@dwimlabs.net>
parents: 6310
diff changeset
136 1: alice
6261
a2491c578d2b topic: namespace revset predicate
Anton Shestakov <av6@dwimlabs.net>
parents: 6245
diff changeset
137 $ nslog 'topicnamespace("re:ice$")'
a2491c578d2b topic: namespace revset predicate
Anton Shestakov <av6@dwimlabs.net>
parents: 6245
diff changeset
138 0: alice
6536
90b631fde2d7 topic: only set topic on workingcommitctx if it doesn't already have one
Anton Shestakov <av6@dwimlabs.net>
parents: 6310
diff changeset
139 1: alice
6261
a2491c578d2b topic: namespace revset predicate
Anton Shestakov <av6@dwimlabs.net>
parents: 6245
diff changeset
140 $ nslog 'topicnamespace(nonsense)'
a2491c578d2b topic: namespace revset predicate
Anton Shestakov <av6@dwimlabs.net>
parents: 6245
diff changeset
141 abort: unknown revision 'nonsense'
a2491c578d2b topic: namespace revset predicate
Anton Shestakov <av6@dwimlabs.net>
parents: 6245
diff changeset
142 [10]
a2491c578d2b topic: namespace revset predicate
Anton Shestakov <av6@dwimlabs.net>
parents: 6245
diff changeset
143
a2491c578d2b topic: namespace revset predicate
Anton Shestakov <av6@dwimlabs.net>
parents: 6245
diff changeset
144 $ nslog 'topicnamespace("re:nonsense")'
a2491c578d2b topic: namespace revset predicate
Anton Shestakov <av6@dwimlabs.net>
parents: 6245
diff changeset
145 $ nslog 'topicnamespace("literal:nonsense")'
a2491c578d2b topic: namespace revset predicate
Anton Shestakov <av6@dwimlabs.net>
parents: 6245
diff changeset
146 abort: topic namespace 'nonsense' does not exist
a2491c578d2b topic: namespace revset predicate
Anton Shestakov <av6@dwimlabs.net>
parents: 6245
diff changeset
147 [10]
a2491c578d2b topic: namespace revset predicate
Anton Shestakov <av6@dwimlabs.net>
parents: 6245
diff changeset
148
6236
7ad8107d953a topic: introduce topic namespaces concept starting with simple parsing
Anton Shestakov <av6@dwimlabs.net>
parents:
diff changeset
149 Parsing
7ad8107d953a topic: introduce topic namespaces concept starting with simple parsing
Anton Shestakov <av6@dwimlabs.net>
parents:
diff changeset
150
7ad8107d953a topic: introduce topic namespaces concept starting with simple parsing
Anton Shestakov <av6@dwimlabs.net>
parents:
diff changeset
151 $ hg debugparsefqbn foo/bar//user26/feature -T '[{branch}] <{topic_namespace}> ({topic})\n'
7ad8107d953a topic: introduce topic namespaces concept starting with simple parsing
Anton Shestakov <av6@dwimlabs.net>
parents:
diff changeset
152 [foo/bar] <user26> (feature)
7ad8107d953a topic: introduce topic namespaces concept starting with simple parsing
Anton Shestakov <av6@dwimlabs.net>
parents:
diff changeset
153
7ad8107d953a topic: introduce topic namespaces concept starting with simple parsing
Anton Shestakov <av6@dwimlabs.net>
parents:
diff changeset
154 no double slashes means it's a named branch
7ad8107d953a topic: introduce topic namespaces concept starting with simple parsing
Anton Shestakov <av6@dwimlabs.net>
parents:
diff changeset
155 $ hg debug-parse-fqbn foo/bar
7ad8107d953a topic: introduce topic namespaces concept starting with simple parsing
Anton Shestakov <av6@dwimlabs.net>
parents:
diff changeset
156 branch: foo/bar
7ad8107d953a topic: introduce topic namespaces concept starting with simple parsing
Anton Shestakov <av6@dwimlabs.net>
parents:
diff changeset
157 namespace: default
7ad8107d953a topic: introduce topic namespaces concept starting with simple parsing
Anton Shestakov <av6@dwimlabs.net>
parents:
diff changeset
158 topic:
6237
0b9042408809 topic: formatting branch, namespace and topic into fully qualified branch name
Anton Shestakov <av6@dwimlabs.net>
parents: 6236
diff changeset
159
0b9042408809 topic: formatting branch, namespace and topic into fully qualified branch name
Anton Shestakov <av6@dwimlabs.net>
parents: 6236
diff changeset
160 Formatting
0b9042408809 topic: formatting branch, namespace and topic into fully qualified branch name
Anton Shestakov <av6@dwimlabs.net>
parents: 6236
diff changeset
161
0b9042408809 topic: formatting branch, namespace and topic into fully qualified branch name
Anton Shestakov <av6@dwimlabs.net>
parents: 6236
diff changeset
162 $ hg debugformatfqbn -b branch -n namespace -t topic
0b9042408809 topic: formatting branch, namespace and topic into fully qualified branch name
Anton Shestakov <av6@dwimlabs.net>
parents: 6236
diff changeset
163 branch//namespace/topic
0b9042408809 topic: formatting branch, namespace and topic into fully qualified branch name
Anton Shestakov <av6@dwimlabs.net>
parents: 6236
diff changeset
164
0b9042408809 topic: formatting branch, namespace and topic into fully qualified branch name
Anton Shestakov <av6@dwimlabs.net>
parents: 6236
diff changeset
165 $ hg debug-format-fqbn -n namespace
0b9042408809 topic: formatting branch, namespace and topic into fully qualified branch name
Anton Shestakov <av6@dwimlabs.net>
parents: 6236
diff changeset
166 //namespace/
0b9042408809 topic: formatting branch, namespace and topic into fully qualified branch name
Anton Shestakov <av6@dwimlabs.net>
parents: 6236
diff changeset
167
0b9042408809 topic: formatting branch, namespace and topic into fully qualified branch name
Anton Shestakov <av6@dwimlabs.net>
parents: 6236
diff changeset
168 $ hg debug-format-fqbn -b foo/bar -n user26 -t feature
0b9042408809 topic: formatting branch, namespace and topic into fully qualified branch name
Anton Shestakov <av6@dwimlabs.net>
parents: 6236
diff changeset
169 foo/bar//user26/feature
0b9042408809 topic: formatting branch, namespace and topic into fully qualified branch name
Anton Shestakov <av6@dwimlabs.net>
parents: 6236
diff changeset
170
6266
213db29a19e9 topic: ability to shorten branch//namespace/topic strings when possible
Anton Shestakov <av6@dwimlabs.net>
parents: 6261
diff changeset
171 default values
213db29a19e9 topic: ability to shorten branch//namespace/topic strings when possible
Anton Shestakov <av6@dwimlabs.net>
parents: 6261
diff changeset
172
6267
1eb543272657 topic: switch to the short fqbn format by default
Anton Shestakov <av6@dwimlabs.net>
parents: 6266
diff changeset
173 $ hg debug-format-fqbn -b default -n default -t '' --no-short
6266
213db29a19e9 topic: ability to shorten branch//namespace/topic strings when possible
Anton Shestakov <av6@dwimlabs.net>
parents: 6261
diff changeset
174 default//default/
213db29a19e9 topic: ability to shorten branch//namespace/topic strings when possible
Anton Shestakov <av6@dwimlabs.net>
parents: 6261
diff changeset
175 $ hg debug-format-fqbn -b default -n default -t '' --short
213db29a19e9 topic: ability to shorten branch//namespace/topic strings when possible
Anton Shestakov <av6@dwimlabs.net>
parents: 6261
diff changeset
176 default
213db29a19e9 topic: ability to shorten branch//namespace/topic strings when possible
Anton Shestakov <av6@dwimlabs.net>
parents: 6261
diff changeset
177
6267
1eb543272657 topic: switch to the short fqbn format by default
Anton Shestakov <av6@dwimlabs.net>
parents: 6266
diff changeset
178 $ hg debug-format-fqbn -b default -n namespace -t '' --no-short
6266
213db29a19e9 topic: ability to shorten branch//namespace/topic strings when possible
Anton Shestakov <av6@dwimlabs.net>
parents: 6261
diff changeset
179 default//namespace/
213db29a19e9 topic: ability to shorten branch//namespace/topic strings when possible
Anton Shestakov <av6@dwimlabs.net>
parents: 6261
diff changeset
180 $ hg debug-format-fqbn -b default -n namespace -t '' --short
213db29a19e9 topic: ability to shorten branch//namespace/topic strings when possible
Anton Shestakov <av6@dwimlabs.net>
parents: 6261
diff changeset
181 default//namespace/
213db29a19e9 topic: ability to shorten branch//namespace/topic strings when possible
Anton Shestakov <av6@dwimlabs.net>
parents: 6261
diff changeset
182
6267
1eb543272657 topic: switch to the short fqbn format by default
Anton Shestakov <av6@dwimlabs.net>
parents: 6266
diff changeset
183 $ hg debug-format-fqbn -b default -n default -t topic --no-short
6266
213db29a19e9 topic: ability to shorten branch//namespace/topic strings when possible
Anton Shestakov <av6@dwimlabs.net>
parents: 6261
diff changeset
184 default//default/topic
213db29a19e9 topic: ability to shorten branch//namespace/topic strings when possible
Anton Shestakov <av6@dwimlabs.net>
parents: 6261
diff changeset
185 $ hg debug-format-fqbn -b default -n default -t topic --short
213db29a19e9 topic: ability to shorten branch//namespace/topic strings when possible
Anton Shestakov <av6@dwimlabs.net>
parents: 6261
diff changeset
186 default//topic
213db29a19e9 topic: ability to shorten branch//namespace/topic strings when possible
Anton Shestakov <av6@dwimlabs.net>
parents: 6261
diff changeset
187
6237
0b9042408809 topic: formatting branch, namespace and topic into fully qualified branch name
Anton Shestakov <av6@dwimlabs.net>
parents: 6236
diff changeset
188 $ cd ..