comparison tests/test-namespaces-reject.t @ 6769:365bdacd7f6a mercurial-4.9

test-compat: merge mercurial-5.0 into mercurial-4.9
author Anton Shestakov <av6@dwimlabs.net>
date Thu, 11 Apr 2024 17:57:48 -0300
parents 80d5e11713f5
children
comparison
equal deleted inserted replaced
6727:a89c96fef4b5 6769:365bdacd7f6a
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 added 1 changesets with 1 changes to 1 files
60 transaction abort!
61 rollback completed
62 abort: rejecting draft changesets with topic namespace: ed9751f04a18
63 [255]
64
65 changesets with topic namespaces are only exchanged if server configuration allows
66
67 $ cat >> ../orig/.hg/hgrc << EOF
68 > [experimental]
69 > tns-reject-push = no
70 > EOF
71
72 $ hg push
73 pushing to $TESTTMP/orig
74 searching for changes
75 adding changesets
76 adding manifests
77 adding file changes
78 added 1 changesets with 1 changes to 1 files
79 topic namespaces affected: bob
80
81 $ cd ..