annotate tests/test-namespaces.t @ 6239:8861e33f3bb2

topic: setting current repo namespace with debug-namespace
author Anton Shestakov <av6@dwimlabs.net>
date Wed, 04 May 2022 15:38:24 +0400
parents 6bbd16579f0f
children 2686ecc90791
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
8861e33f3bb2 topic: setting current repo namespace with debug-namespace
Anton Shestakov <av6@dwimlabs.net>
parents: 6238
diff changeset
13 $ hg branches
8861e33f3bb2 topic: setting current repo namespace with debug-namespace
Anton Shestakov <av6@dwimlabs.net>
parents: 6238
diff changeset
14
8861e33f3bb2 topic: setting current repo namespace with debug-namespace
Anton Shestakov <av6@dwimlabs.net>
parents: 6238
diff changeset
15 $ hg debug-topic-namespace --clear
6238
6bbd16579f0f topic: list namespaces with debug-namespaces
Anton Shestakov <av6@dwimlabs.net>
parents: 6237
diff changeset
16 $ hg debug-topic-namespaces
6bbd16579f0f topic: list namespaces with debug-namespaces
Anton Shestakov <av6@dwimlabs.net>
parents: 6237
diff changeset
17 default
6bbd16579f0f topic: list namespaces with debug-namespaces
Anton Shestakov <av6@dwimlabs.net>
parents: 6237
diff changeset
18
6239
8861e33f3bb2 topic: setting current repo namespace with debug-namespace
Anton Shestakov <av6@dwimlabs.net>
parents: 6238
diff changeset
19 $ hg debugtopicnamespace --clear nonsense
8861e33f3bb2 topic: setting current repo namespace with debug-namespace
Anton Shestakov <av6@dwimlabs.net>
parents: 6238
diff changeset
20 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
21 [255]
8861e33f3bb2 topic: setting current repo namespace with debug-namespace
Anton Shestakov <av6@dwimlabs.net>
parents: 6238
diff changeset
22
6236
7ad8107d953a topic: introduce topic namespaces concept starting with simple parsing
Anton Shestakov <av6@dwimlabs.net>
parents:
diff changeset
23 Parsing
7ad8107d953a topic: introduce topic namespaces concept starting with simple parsing
Anton Shestakov <av6@dwimlabs.net>
parents:
diff changeset
24
7ad8107d953a topic: introduce topic namespaces concept starting with simple parsing
Anton Shestakov <av6@dwimlabs.net>
parents:
diff changeset
25 $ 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
26 [foo/bar] <user26> (feature)
7ad8107d953a topic: introduce topic namespaces concept starting with simple parsing
Anton Shestakov <av6@dwimlabs.net>
parents:
diff changeset
27
7ad8107d953a topic: introduce topic namespaces concept starting with simple parsing
Anton Shestakov <av6@dwimlabs.net>
parents:
diff changeset
28 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
29 $ hg debug-parse-fqbn foo/bar
7ad8107d953a topic: introduce topic namespaces concept starting with simple parsing
Anton Shestakov <av6@dwimlabs.net>
parents:
diff changeset
30 branch: foo/bar
7ad8107d953a topic: introduce topic namespaces concept starting with simple parsing
Anton Shestakov <av6@dwimlabs.net>
parents:
diff changeset
31 namespace: default
7ad8107d953a topic: introduce topic namespaces concept starting with simple parsing
Anton Shestakov <av6@dwimlabs.net>
parents:
diff changeset
32 topic:
6237
0b9042408809 topic: formatting branch, namespace and topic into fully qualified branch name
Anton Shestakov <av6@dwimlabs.net>
parents: 6236
diff changeset
33
0b9042408809 topic: formatting branch, namespace and topic into fully qualified branch name
Anton Shestakov <av6@dwimlabs.net>
parents: 6236
diff changeset
34 Formatting
0b9042408809 topic: formatting branch, namespace and topic into fully qualified branch name
Anton Shestakov <av6@dwimlabs.net>
parents: 6236
diff changeset
35
0b9042408809 topic: formatting branch, namespace and topic into fully qualified branch name
Anton Shestakov <av6@dwimlabs.net>
parents: 6236
diff changeset
36 $ 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
37 branch//namespace/topic
0b9042408809 topic: formatting branch, namespace and topic into fully qualified branch name
Anton Shestakov <av6@dwimlabs.net>
parents: 6236
diff changeset
38
0b9042408809 topic: formatting branch, namespace and topic into fully qualified branch name
Anton Shestakov <av6@dwimlabs.net>
parents: 6236
diff changeset
39 $ 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
40 //namespace/
0b9042408809 topic: formatting branch, namespace and topic into fully qualified branch name
Anton Shestakov <av6@dwimlabs.net>
parents: 6236
diff changeset
41
0b9042408809 topic: formatting branch, namespace and topic into fully qualified branch name
Anton Shestakov <av6@dwimlabs.net>
parents: 6236
diff changeset
42 $ 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
43 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
44
0b9042408809 topic: formatting branch, namespace and topic into fully qualified branch name
Anton Shestakov <av6@dwimlabs.net>
parents: 6236
diff changeset
45 $ cd ..