comparison tests/test-namespaces-reject.t @ 6743:ab60707314e9 stable

topic: new experimental.tns-reject-push config to refuse changesets with tns
author Anton Shestakov <av6@dwimlabs.net>
date Fri, 15 Mar 2024 17:05:09 -0300
parents
children 80d5e11713f5
comparison
equal deleted inserted replaced
6742:0592ae24c470 6743:ab60707314e9
1 Rejecting changesets with any topic namespaces during push
2
3 $ . "$TESTDIR/testlib/common.sh"
4
5 $ cat >> $HGRCPATH << EOF
6 > [extensions]
7 > topic =
8 > [phases]
9 > publish = no
10 > [devel]
11 > tns-report-transactions = push
12 > [ui]
13 > logtemplate = "{rev}: {desc} {fqbn} ({phase})\n"
14 > EOF
15
16 $ hg init orig
17 $ hg clone orig clone -q
18
19 $ cd clone
20
21 changesets without topic namespace are freely exchanged
22
23 $ echo apple > a
24 $ hg debug-topic-namespace --clear
25 $ hg topic apple
26 marked working directory as topic: apple
27 $ hg ci -qAm apple
28
29 $ hg log -r . -T '{rev}: {join(extras, " ")}\n'
30 0: branch=default topic=apple
31
32 $ hg push
33 pushing to * (glob)
34 searching for changes
35 adding changesets
36 adding manifests
37 adding file changes
38 added 1 changesets with 1 changes to 1 files
39
40 changesets with topic namespaces are rejected when server configuration disallows
41
42 $ cat >> ../orig/.hg/hgrc << EOF
43 > [experimental]
44 > tns-reject-push = yes
45 > EOF
46
47 $ echo banana > b
48 $ hg debug-topic-namespace bob
49 marked working directory as topic namespace: bob
50 $ hg topic banana
51 $ hg ci -qAm 'banana'
52
53 $ hg push
54 pushing to $TESTTMP/orig
55 searching for changes
56 adding changesets
57 adding manifests
58 adding file changes
59 transaction abort!
60 rollback completed
61 abort: rejecting draft changesets with topic namespace: ed9751f04a18
62 [255]
63
64 changesets with topic namespaces are only exchanged if server configuration allows
65
66 $ cat >> ../orig/.hg/hgrc << EOF
67 > [experimental]
68 > tns-reject-push = no
69 > EOF
70
71 $ hg push
72 pushing to $TESTTMP/orig
73 searching for changes
74 adding changesets
75 adding manifests
76 adding file changes
77 topic namespaces affected: bob
78 added 1 changesets with 1 changes to 1 files
79
80 $ cd ..