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