annotate tests/test-namespaces-reject.t @ 6889:a66cf9008781

obslog: also display patch for rebased changesets This applies the same logic that is used for "merge-diff" to rebased changesets. The successors' content is compared to the content of the predecessors rebased in-memory on the new parents. This highlights the changes that were actually introduced while rebasing (like conflict resolution or API adjustment). As a side effect, obslog now also outputs slightly more diffs for splits, showing what parts of the original big changeset were moved to the smaller split components (but for now it only works for the first few changesets).
author Pierre-Yves David <pierre-yves.david@octobus.net>
date Sun, 22 Sep 2024 02:58:54 +0200
parents ab60707314e9
children 80d5e11713f5
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
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
ab60707314e9 topic: new experimental.tns-reject-push config to refuse changesets with tns
Anton Shestakov <av6@dwimlabs.net>
parents:
diff changeset
59 transaction abort!
ab60707314e9 topic: new experimental.tns-reject-push config to refuse changesets with tns
Anton Shestakov <av6@dwimlabs.net>
parents:
diff changeset
60 rollback completed
ab60707314e9 topic: new experimental.tns-reject-push config to refuse changesets with tns
Anton Shestakov <av6@dwimlabs.net>
parents:
diff changeset
61 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
62 [255]
ab60707314e9 topic: new experimental.tns-reject-push config to refuse changesets with tns
Anton Shestakov <av6@dwimlabs.net>
parents:
diff changeset
63
ab60707314e9 topic: new experimental.tns-reject-push config to refuse changesets with tns
Anton Shestakov <av6@dwimlabs.net>
parents:
diff changeset
64 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
65
ab60707314e9 topic: new experimental.tns-reject-push config to refuse changesets with tns
Anton Shestakov <av6@dwimlabs.net>
parents:
diff changeset
66 $ 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
67 > [experimental]
ab60707314e9 topic: new experimental.tns-reject-push config to refuse changesets with tns
Anton Shestakov <av6@dwimlabs.net>
parents:
diff changeset
68 > 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
69 > EOF
ab60707314e9 topic: new experimental.tns-reject-push config to refuse changesets with tns
Anton Shestakov <av6@dwimlabs.net>
parents:
diff changeset
70
ab60707314e9 topic: new experimental.tns-reject-push config to refuse changesets with tns
Anton Shestakov <av6@dwimlabs.net>
parents:
diff changeset
71 $ hg push
ab60707314e9 topic: new experimental.tns-reject-push config to refuse changesets with tns
Anton Shestakov <av6@dwimlabs.net>
parents:
diff changeset
72 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
73 searching for changes
ab60707314e9 topic: new experimental.tns-reject-push config to refuse changesets with tns
Anton Shestakov <av6@dwimlabs.net>
parents:
diff changeset
74 adding changesets
ab60707314e9 topic: new experimental.tns-reject-push config to refuse changesets with tns
Anton Shestakov <av6@dwimlabs.net>
parents:
diff changeset
75 adding manifests
ab60707314e9 topic: new experimental.tns-reject-push config to refuse changesets with tns
Anton Shestakov <av6@dwimlabs.net>
parents:
diff changeset
76 adding file changes
ab60707314e9 topic: new experimental.tns-reject-push config to refuse changesets with tns
Anton Shestakov <av6@dwimlabs.net>
parents:
diff changeset
77 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
78 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
79
ab60707314e9 topic: new experimental.tns-reject-push config to refuse changesets with tns
Anton Shestakov <av6@dwimlabs.net>
parents:
diff changeset
80 $ cd ..