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