annotate tests/test-namespaces-precheck.t @ 6917:a7929709e89f mercurial-5.3

test-compat: merge mercurial-5.4 into mercurial-5.3
author Anton Shestakov <av6@dwimlabs.net>
date Fri, 25 Oct 2024 17:25:27 +0400
parents a62308fb15c1
children 81853c544896
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
6537
80d5d4e587f7 topic: experimental config option and topic namespace checking in precheck()
Anton Shestakov <av6@dwimlabs.net>
parents:
diff changeset
1 Checking affected topic namespaces before history rewrites
80d5d4e587f7 topic: experimental config option and topic namespace checking in precheck()
Anton Shestakov <av6@dwimlabs.net>
parents:
diff changeset
2 ==========================================================
80d5d4e587f7 topic: experimental config option and topic namespace checking in precheck()
Anton Shestakov <av6@dwimlabs.net>
parents:
diff changeset
3
80d5d4e587f7 topic: experimental config option and topic namespace checking in precheck()
Anton Shestakov <av6@dwimlabs.net>
parents:
diff changeset
4 $ . "$TESTDIR/testlib/common.sh"
80d5d4e587f7 topic: experimental config option and topic namespace checking in precheck()
Anton Shestakov <av6@dwimlabs.net>
parents:
diff changeset
5
80d5d4e587f7 topic: experimental config option and topic namespace checking in precheck()
Anton Shestakov <av6@dwimlabs.net>
parents:
diff changeset
6 $ cat >> $HGRCPATH << EOF
80d5d4e587f7 topic: experimental config option and topic namespace checking in precheck()
Anton Shestakov <av6@dwimlabs.net>
parents:
diff changeset
7 > [extensions]
80d5d4e587f7 topic: experimental config option and topic namespace checking in precheck()
Anton Shestakov <av6@dwimlabs.net>
parents:
diff changeset
8 > evolve =
80d5d4e587f7 topic: experimental config option and topic namespace checking in precheck()
Anton Shestakov <av6@dwimlabs.net>
parents:
diff changeset
9 > topic =
80d5d4e587f7 topic: experimental config option and topic namespace checking in precheck()
Anton Shestakov <av6@dwimlabs.net>
parents:
diff changeset
10 > rebase =
80d5d4e587f7 topic: experimental config option and topic namespace checking in precheck()
Anton Shestakov <av6@dwimlabs.net>
parents:
diff changeset
11 > histedit =
80d5d4e587f7 topic: experimental config option and topic namespace checking in precheck()
Anton Shestakov <av6@dwimlabs.net>
parents:
diff changeset
12 > [phases]
80d5d4e587f7 topic: experimental config option and topic namespace checking in precheck()
Anton Shestakov <av6@dwimlabs.net>
parents:
diff changeset
13 > publish = no
80d5d4e587f7 topic: experimental config option and topic namespace checking in precheck()
Anton Shestakov <av6@dwimlabs.net>
parents:
diff changeset
14 > [experimental]
80d5d4e587f7 topic: experimental config option and topic namespace checking in precheck()
Anton Shestakov <av6@dwimlabs.net>
parents:
diff changeset
15 > tns-allow-rewrite =
80d5d4e587f7 topic: experimental config option and topic namespace checking in precheck()
Anton Shestakov <av6@dwimlabs.net>
parents:
diff changeset
16 > EOF
80d5d4e587f7 topic: experimental config option and topic namespace checking in precheck()
Anton Shestakov <av6@dwimlabs.net>
parents:
diff changeset
17
80d5d4e587f7 topic: experimental config option and topic namespace checking in precheck()
Anton Shestakov <av6@dwimlabs.net>
parents:
diff changeset
18 $ hg init repo
80d5d4e587f7 topic: experimental config option and topic namespace checking in precheck()
Anton Shestakov <av6@dwimlabs.net>
parents:
diff changeset
19 $ cd repo
80d5d4e587f7 topic: experimental config option and topic namespace checking in precheck()
Anton Shestakov <av6@dwimlabs.net>
parents:
diff changeset
20
80d5d4e587f7 topic: experimental config option and topic namespace checking in precheck()
Anton Shestakov <av6@dwimlabs.net>
parents:
diff changeset
21 Make sure general checks in precheck() happen before topic namespaces checks
80d5d4e587f7 topic: experimental config option and topic namespace checking in precheck()
Anton Shestakov <av6@dwimlabs.net>
parents:
diff changeset
22
80d5d4e587f7 topic: experimental config option and topic namespace checking in precheck()
Anton Shestakov <av6@dwimlabs.net>
parents:
diff changeset
23 $ hg prune null
6583
e846964c93c2 test-compat: merge mercurial-5.9 into mercurial-5.8
Anton Shestakov <av6@dwimlabs.net>
parents: 6537
diff changeset
24 abort: cannot prune null changeset
6537
80d5d4e587f7 topic: experimental config option and topic namespace checking in precheck()
Anton Shestakov <av6@dwimlabs.net>
parents:
diff changeset
25 (no changeset checked out)
6585
a62308fb15c1 test-compat: merge mercurial-5.7 into mercurial-5.6
Anton Shestakov <av6@dwimlabs.net>
parents: 6583
diff changeset
26 [255]
6537
80d5d4e587f7 topic: experimental config option and topic namespace checking in precheck()
Anton Shestakov <av6@dwimlabs.net>
parents:
diff changeset
27
80d5d4e587f7 topic: experimental config option and topic namespace checking in precheck()
Anton Shestakov <av6@dwimlabs.net>
parents:
diff changeset
28 $ echo apple > a
80d5d4e587f7 topic: experimental config option and topic namespace checking in precheck()
Anton Shestakov <av6@dwimlabs.net>
parents:
diff changeset
29 $ hg ci -qAm apple
80d5d4e587f7 topic: experimental config option and topic namespace checking in precheck()
Anton Shestakov <av6@dwimlabs.net>
parents:
diff changeset
30
80d5d4e587f7 topic: experimental config option and topic namespace checking in precheck()
Anton Shestakov <av6@dwimlabs.net>
parents:
diff changeset
31 $ hg debug-topic-namespace foo
80d5d4e587f7 topic: experimental config option and topic namespace checking in precheck()
Anton Shestakov <av6@dwimlabs.net>
parents:
diff changeset
32 marked working directory as topic namespace: foo
80d5d4e587f7 topic: experimental config option and topic namespace checking in precheck()
Anton Shestakov <av6@dwimlabs.net>
parents:
diff changeset
33 $ hg topic bar
80d5d4e587f7 topic: experimental config option and topic namespace checking in precheck()
Anton Shestakov <av6@dwimlabs.net>
parents:
diff changeset
34 marked working directory as topic: bar
80d5d4e587f7 topic: experimental config option and topic namespace checking in precheck()
Anton Shestakov <av6@dwimlabs.net>
parents:
diff changeset
35 $ echo banana > b
80d5d4e587f7 topic: experimental config option and topic namespace checking in precheck()
Anton Shestakov <av6@dwimlabs.net>
parents:
diff changeset
36 $ hg ci -qAm 'banana'
80d5d4e587f7 topic: experimental config option and topic namespace checking in precheck()
Anton Shestakov <av6@dwimlabs.net>
parents:
diff changeset
37
80d5d4e587f7 topic: experimental config option and topic namespace checking in precheck()
Anton Shestakov <av6@dwimlabs.net>
parents:
diff changeset
38 Allowing topic namespaces with --config works correctly
80d5d4e587f7 topic: experimental config option and topic namespace checking in precheck()
Anton Shestakov <av6@dwimlabs.net>
parents:
diff changeset
39
80d5d4e587f7 topic: experimental config option and topic namespace checking in precheck()
Anton Shestakov <av6@dwimlabs.net>
parents:
diff changeset
40 $ echo broccoli > b
80d5d4e587f7 topic: experimental config option and topic namespace checking in precheck()
Anton Shestakov <av6@dwimlabs.net>
parents:
diff changeset
41 $ hg amend -m 'broccoli'
80d5d4e587f7 topic: experimental config option and topic namespace checking in precheck()
Anton Shestakov <av6@dwimlabs.net>
parents:
diff changeset
42 abort: refusing to amend changesets with these topic namespaces: foo
80d5d4e587f7 topic: experimental config option and topic namespace checking in precheck()
Anton Shestakov <av6@dwimlabs.net>
parents:
diff changeset
43 (modify experimental.tns-allow-rewrite to allow rewriting changesets from these topic namespaces)
6585
a62308fb15c1 test-compat: merge mercurial-5.7 into mercurial-5.6
Anton Shestakov <av6@dwimlabs.net>
parents: 6583
diff changeset
44 [255]
6537
80d5d4e587f7 topic: experimental config option and topic namespace checking in precheck()
Anton Shestakov <av6@dwimlabs.net>
parents:
diff changeset
45 $ hg amend -m 'broccoli' --config experimental.tns-allow-rewrite=foo,something-unrelated
80d5d4e587f7 topic: experimental config option and topic namespace checking in precheck()
Anton Shestakov <av6@dwimlabs.net>
parents:
diff changeset
46
80d5d4e587f7 topic: experimental config option and topic namespace checking in precheck()
Anton Shestakov <av6@dwimlabs.net>
parents:
diff changeset
47 $ echo coconut > b
80d5d4e587f7 topic: experimental config option and topic namespace checking in precheck()
Anton Shestakov <av6@dwimlabs.net>
parents:
diff changeset
48 $ hg ci -qAm 'coconut'
80d5d4e587f7 topic: experimental config option and topic namespace checking in precheck()
Anton Shestakov <av6@dwimlabs.net>
parents:
diff changeset
49
80d5d4e587f7 topic: experimental config option and topic namespace checking in precheck()
Anton Shestakov <av6@dwimlabs.net>
parents:
diff changeset
50 Testing history-rewriting commands from evolve extension
80d5d4e587f7 topic: experimental config option and topic namespace checking in precheck()
Anton Shestakov <av6@dwimlabs.net>
parents:
diff changeset
51
80d5d4e587f7 topic: experimental config option and topic namespace checking in precheck()
Anton Shestakov <av6@dwimlabs.net>
parents:
diff changeset
52 $ hg amend -m 'coconut'
80d5d4e587f7 topic: experimental config option and topic namespace checking in precheck()
Anton Shestakov <av6@dwimlabs.net>
parents:
diff changeset
53 abort: refusing to amend changesets with these topic namespaces: foo
80d5d4e587f7 topic: experimental config option and topic namespace checking in precheck()
Anton Shestakov <av6@dwimlabs.net>
parents:
diff changeset
54 (modify experimental.tns-allow-rewrite to allow rewriting changesets from these topic namespaces)
6585
a62308fb15c1 test-compat: merge mercurial-5.7 into mercurial-5.6
Anton Shestakov <av6@dwimlabs.net>
parents: 6583
diff changeset
55 [255]
6537
80d5d4e587f7 topic: experimental config option and topic namespace checking in precheck()
Anton Shestakov <av6@dwimlabs.net>
parents:
diff changeset
56 $ hg amend --patch -m 'coconut'
80d5d4e587f7 topic: experimental config option and topic namespace checking in precheck()
Anton Shestakov <av6@dwimlabs.net>
parents:
diff changeset
57 abort: refusing to amend changesets with these topic namespaces: foo
80d5d4e587f7 topic: experimental config option and topic namespace checking in precheck()
Anton Shestakov <av6@dwimlabs.net>
parents:
diff changeset
58 (modify experimental.tns-allow-rewrite to allow rewriting changesets from these topic namespaces)
6585
a62308fb15c1 test-compat: merge mercurial-5.7 into mercurial-5.6
Anton Shestakov <av6@dwimlabs.net>
parents: 6583
diff changeset
59 [255]
6537
80d5d4e587f7 topic: experimental config option and topic namespace checking in precheck()
Anton Shestakov <av6@dwimlabs.net>
parents:
diff changeset
60 $ hg uncommit
80d5d4e587f7 topic: experimental config option and topic namespace checking in precheck()
Anton Shestakov <av6@dwimlabs.net>
parents:
diff changeset
61 abort: refusing to uncommit changesets with these topic namespaces: foo
80d5d4e587f7 topic: experimental config option and topic namespace checking in precheck()
Anton Shestakov <av6@dwimlabs.net>
parents:
diff changeset
62 (modify experimental.tns-allow-rewrite to allow rewriting changesets from these topic namespaces)
6585
a62308fb15c1 test-compat: merge mercurial-5.7 into mercurial-5.6
Anton Shestakov <av6@dwimlabs.net>
parents: 6583
diff changeset
63 [255]
6537
80d5d4e587f7 topic: experimental config option and topic namespace checking in precheck()
Anton Shestakov <av6@dwimlabs.net>
parents:
diff changeset
64 $ hg prune -r .
80d5d4e587f7 topic: experimental config option and topic namespace checking in precheck()
Anton Shestakov <av6@dwimlabs.net>
parents:
diff changeset
65 abort: refusing to prune changesets with these topic namespaces: foo
80d5d4e587f7 topic: experimental config option and topic namespace checking in precheck()
Anton Shestakov <av6@dwimlabs.net>
parents:
diff changeset
66 (modify experimental.tns-allow-rewrite to allow rewriting changesets from these topic namespaces)
6585
a62308fb15c1 test-compat: merge mercurial-5.7 into mercurial-5.6
Anton Shestakov <av6@dwimlabs.net>
parents: 6583
diff changeset
67 [255]
6537
80d5d4e587f7 topic: experimental config option and topic namespace checking in precheck()
Anton Shestakov <av6@dwimlabs.net>
parents:
diff changeset
68 $ hg split -r .
80d5d4e587f7 topic: experimental config option and topic namespace checking in precheck()
Anton Shestakov <av6@dwimlabs.net>
parents:
diff changeset
69 abort: refusing to split changesets with these topic namespaces: foo
80d5d4e587f7 topic: experimental config option and topic namespace checking in precheck()
Anton Shestakov <av6@dwimlabs.net>
parents:
diff changeset
70 (modify experimental.tns-allow-rewrite to allow rewriting changesets from these topic namespaces)
6585
a62308fb15c1 test-compat: merge mercurial-5.7 into mercurial-5.6
Anton Shestakov <av6@dwimlabs.net>
parents: 6583
diff changeset
71 [255]
6537
80d5d4e587f7 topic: experimental config option and topic namespace checking in precheck()
Anton Shestakov <av6@dwimlabs.net>
parents:
diff changeset
72 $ hg touch -r .
80d5d4e587f7 topic: experimental config option and topic namespace checking in precheck()
Anton Shestakov <av6@dwimlabs.net>
parents:
diff changeset
73 abort: refusing to touch changesets with these topic namespaces: foo
80d5d4e587f7 topic: experimental config option and topic namespace checking in precheck()
Anton Shestakov <av6@dwimlabs.net>
parents:
diff changeset
74 (modify experimental.tns-allow-rewrite to allow rewriting changesets from these topic namespaces)
6585
a62308fb15c1 test-compat: merge mercurial-5.7 into mercurial-5.6
Anton Shestakov <av6@dwimlabs.net>
parents: 6583
diff changeset
75 [255]
6537
80d5d4e587f7 topic: experimental config option and topic namespace checking in precheck()
Anton Shestakov <av6@dwimlabs.net>
parents:
diff changeset
76
80d5d4e587f7 topic: experimental config option and topic namespace checking in precheck()
Anton Shestakov <av6@dwimlabs.net>
parents:
diff changeset
77 Testing core history-rewriting commands
80d5d4e587f7 topic: experimental config option and topic namespace checking in precheck()
Anton Shestakov <av6@dwimlabs.net>
parents:
diff changeset
78
80d5d4e587f7 topic: experimental config option and topic namespace checking in precheck()
Anton Shestakov <av6@dwimlabs.net>
parents:
diff changeset
79 $ hg ci --amend
80d5d4e587f7 topic: experimental config option and topic namespace checking in precheck()
Anton Shestakov <av6@dwimlabs.net>
parents:
diff changeset
80 abort: refusing to amend changesets with these topic namespaces: foo
80d5d4e587f7 topic: experimental config option and topic namespace checking in precheck()
Anton Shestakov <av6@dwimlabs.net>
parents:
diff changeset
81 (modify experimental.tns-allow-rewrite to allow rewriting changesets from these topic namespaces)
6585
a62308fb15c1 test-compat: merge mercurial-5.7 into mercurial-5.6
Anton Shestakov <av6@dwimlabs.net>
parents: 6583
diff changeset
82 [255]
6537
80d5d4e587f7 topic: experimental config option and topic namespace checking in precheck()
Anton Shestakov <av6@dwimlabs.net>
parents:
diff changeset
83 $ hg branch different-branch --rev .
80d5d4e587f7 topic: experimental config option and topic namespace checking in precheck()
Anton Shestakov <av6@dwimlabs.net>
parents:
diff changeset
84 abort: refusing to change branch of changesets with these topic namespaces: foo
80d5d4e587f7 topic: experimental config option and topic namespace checking in precheck()
Anton Shestakov <av6@dwimlabs.net>
parents:
diff changeset
85 (modify experimental.tns-allow-rewrite to allow rewriting changesets from these topic namespaces)
6585
a62308fb15c1 test-compat: merge mercurial-5.7 into mercurial-5.6
Anton Shestakov <av6@dwimlabs.net>
parents: 6583
diff changeset
86 [255]
6537
80d5d4e587f7 topic: experimental config option and topic namespace checking in precheck()
Anton Shestakov <av6@dwimlabs.net>
parents:
diff changeset
87 $ hg rebase -r . -d null
80d5d4e587f7 topic: experimental config option and topic namespace checking in precheck()
Anton Shestakov <av6@dwimlabs.net>
parents:
diff changeset
88 abort: refusing to rebase changesets with these topic namespaces: foo
80d5d4e587f7 topic: experimental config option and topic namespace checking in precheck()
Anton Shestakov <av6@dwimlabs.net>
parents:
diff changeset
89 (modify experimental.tns-allow-rewrite to allow rewriting changesets from these topic namespaces)
6585
a62308fb15c1 test-compat: merge mercurial-5.7 into mercurial-5.6
Anton Shestakov <av6@dwimlabs.net>
parents: 6583
diff changeset
90 [255]
6537
80d5d4e587f7 topic: experimental config option and topic namespace checking in precheck()
Anton Shestakov <av6@dwimlabs.net>
parents:
diff changeset
91 $ hg histedit
80d5d4e587f7 topic: experimental config option and topic namespace checking in precheck()
Anton Shestakov <av6@dwimlabs.net>
parents:
diff changeset
92 abort: refusing to edit changesets with these topic namespaces: foo
80d5d4e587f7 topic: experimental config option and topic namespace checking in precheck()
Anton Shestakov <av6@dwimlabs.net>
parents:
diff changeset
93 (modify experimental.tns-allow-rewrite to allow rewriting changesets from these topic namespaces)
6585
a62308fb15c1 test-compat: merge mercurial-5.7 into mercurial-5.6
Anton Shestakov <av6@dwimlabs.net>
parents: 6583
diff changeset
94 [255]
6537
80d5d4e587f7 topic: experimental config option and topic namespace checking in precheck()
Anton Shestakov <av6@dwimlabs.net>
parents:
diff changeset
95
80d5d4e587f7 topic: experimental config option and topic namespace checking in precheck()
Anton Shestakov <av6@dwimlabs.net>
parents:
diff changeset
96 $ cd ..