annotate tests/test-topicmode.t @ 3028:c2d1f49ac7e2

topicmode: add 'random' topic mode That mode will generate a random topic name when the user is about to commit an untopiced changeset.
author Boris Feld <boris.feld@octobus.net>
date Sun, 01 Oct 2017 00:35:28 +0100
parents b220e2f5ebd5
children
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
3023
cc740c545776 topicmode: add new warning topicmode
Boris Feld <boris.feld@octobus.net>
parents:
diff changeset
1 $ . "$TESTDIR/testlib/topic_setup.sh"
cc740c545776 topicmode: add new warning topicmode
Boris Feld <boris.feld@octobus.net>
parents:
diff changeset
2
cc740c545776 topicmode: add new warning topicmode
Boris Feld <boris.feld@octobus.net>
parents:
diff changeset
3 Testing the new config knob to forbid untopiced commit
cc740c545776 topicmode: add new warning topicmode
Boris Feld <boris.feld@octobus.net>
parents:
diff changeset
4 ======================================================
cc740c545776 topicmode: add new warning topicmode
Boris Feld <boris.feld@octobus.net>
parents:
diff changeset
5
cc740c545776 topicmode: add new warning topicmode
Boris Feld <boris.feld@octobus.net>
parents:
diff changeset
6 $ hg init $TESTTMP/untopic-commit
cc740c545776 topicmode: add new warning topicmode
Boris Feld <boris.feld@octobus.net>
parents:
diff changeset
7 $ cd $TESTTMP/untopic-commit
cc740c545776 topicmode: add new warning topicmode
Boris Feld <boris.feld@octobus.net>
parents:
diff changeset
8 $ cat <<EOF >> .hg/hgrc
cc740c545776 topicmode: add new warning topicmode
Boris Feld <boris.feld@octobus.net>
parents:
diff changeset
9 > [phases]
cc740c545776 topicmode: add new warning topicmode
Boris Feld <boris.feld@octobus.net>
parents:
diff changeset
10 > publish=false
cc740c545776 topicmode: add new warning topicmode
Boris Feld <boris.feld@octobus.net>
parents:
diff changeset
11 > EOF
cc740c545776 topicmode: add new warning topicmode
Boris Feld <boris.feld@octobus.net>
parents:
diff changeset
12 $ cat <<EOF >> $HGRCPATH
cc740c545776 topicmode: add new warning topicmode
Boris Feld <boris.feld@octobus.net>
parents:
diff changeset
13 > [experimental]
cc740c545776 topicmode: add new warning topicmode
Boris Feld <boris.feld@octobus.net>
parents:
diff changeset
14 > topic-mode = enforce
cc740c545776 topicmode: add new warning topicmode
Boris Feld <boris.feld@octobus.net>
parents:
diff changeset
15 > EOF
cc740c545776 topicmode: add new warning topicmode
Boris Feld <boris.feld@octobus.net>
parents:
diff changeset
16 $ touch a b c d
cc740c545776 topicmode: add new warning topicmode
Boris Feld <boris.feld@octobus.net>
parents:
diff changeset
17 $ hg add a
cc740c545776 topicmode: add new warning topicmode
Boris Feld <boris.feld@octobus.net>
parents:
diff changeset
18 $ hg ci -m "Added a"
cc740c545776 topicmode: add new warning topicmode
Boris Feld <boris.feld@octobus.net>
parents:
diff changeset
19 abort: no active topic
3027
b220e2f5ebd5 topic: update the topic-mode hint
Pierre-Yves David <pierre-yves.david@octobus.net>
parents: 3025
diff changeset
20 (see 'hg help -e topic.topic-mode' for details)
3023
cc740c545776 topicmode: add new warning topicmode
Boris Feld <boris.feld@octobus.net>
parents:
diff changeset
21 [255]
cc740c545776 topicmode: add new warning topicmode
Boris Feld <boris.feld@octobus.net>
parents:
diff changeset
22
cc740c545776 topicmode: add new warning topicmode
Boris Feld <boris.feld@octobus.net>
parents:
diff changeset
23 (same test, checking we abort before the editor)
cc740c545776 topicmode: add new warning topicmode
Boris Feld <boris.feld@octobus.net>
parents:
diff changeset
24
cc740c545776 topicmode: add new warning topicmode
Boris Feld <boris.feld@octobus.net>
parents:
diff changeset
25 $ EDITOR=cat hg ci -m "Added a" --edit
cc740c545776 topicmode: add new warning topicmode
Boris Feld <boris.feld@octobus.net>
parents:
diff changeset
26 abort: no active topic
3027
b220e2f5ebd5 topic: update the topic-mode hint
Pierre-Yves David <pierre-yves.david@octobus.net>
parents: 3025
diff changeset
27 (see 'hg help -e topic.topic-mode' for details)
3023
cc740c545776 topicmode: add new warning topicmode
Boris Feld <boris.feld@octobus.net>
parents:
diff changeset
28 [255]
cc740c545776 topicmode: add new warning topicmode
Boris Feld <boris.feld@octobus.net>
parents:
diff changeset
29 $ hg ci -m "added a" --config experimental.topic-mode=off
cc740c545776 topicmode: add new warning topicmode
Boris Feld <boris.feld@octobus.net>
parents:
diff changeset
30 $ hg log
cc740c545776 topicmode: add new warning topicmode
Boris Feld <boris.feld@octobus.net>
parents:
diff changeset
31 changeset: 0:a154386e50d1
cc740c545776 topicmode: add new warning topicmode
Boris Feld <boris.feld@octobus.net>
parents:
diff changeset
32 tag: tip
cc740c545776 topicmode: add new warning topicmode
Boris Feld <boris.feld@octobus.net>
parents:
diff changeset
33 user: test
cc740c545776 topicmode: add new warning topicmode
Boris Feld <boris.feld@octobus.net>
parents:
diff changeset
34 date: Thu Jan 01 00:00:00 1970 +0000
cc740c545776 topicmode: add new warning topicmode
Boris Feld <boris.feld@octobus.net>
parents:
diff changeset
35 summary: added a
cc740c545776 topicmode: add new warning topicmode
Boris Feld <boris.feld@octobus.net>
parents:
diff changeset
36
cc740c545776 topicmode: add new warning topicmode
Boris Feld <boris.feld@octobus.net>
parents:
diff changeset
37
cc740c545776 topicmode: add new warning topicmode
Boris Feld <boris.feld@octobus.net>
parents:
diff changeset
38 Testing the new config knob to warn about untopiced commit
cc740c545776 topicmode: add new warning topicmode
Boris Feld <boris.feld@octobus.net>
parents:
diff changeset
39 ==========================================================
cc740c545776 topicmode: add new warning topicmode
Boris Feld <boris.feld@octobus.net>
parents:
diff changeset
40
cc740c545776 topicmode: add new warning topicmode
Boris Feld <boris.feld@octobus.net>
parents:
diff changeset
41 $ hg init $TESTTMP/untopic-warn-commit
cc740c545776 topicmode: add new warning topicmode
Boris Feld <boris.feld@octobus.net>
parents:
diff changeset
42 $ cd $TESTTMP/untopic-warn-commit
cc740c545776 topicmode: add new warning topicmode
Boris Feld <boris.feld@octobus.net>
parents:
diff changeset
43 $ cat <<EOF >> .hg/hgrc
cc740c545776 topicmode: add new warning topicmode
Boris Feld <boris.feld@octobus.net>
parents:
diff changeset
44 > [phases]
cc740c545776 topicmode: add new warning topicmode
Boris Feld <boris.feld@octobus.net>
parents:
diff changeset
45 > publish=false
cc740c545776 topicmode: add new warning topicmode
Boris Feld <boris.feld@octobus.net>
parents:
diff changeset
46 > EOF
cc740c545776 topicmode: add new warning topicmode
Boris Feld <boris.feld@octobus.net>
parents:
diff changeset
47 $ cat <<EOF >> $HGRCPATH
cc740c545776 topicmode: add new warning topicmode
Boris Feld <boris.feld@octobus.net>
parents:
diff changeset
48 > [experimental]
cc740c545776 topicmode: add new warning topicmode
Boris Feld <boris.feld@octobus.net>
parents:
diff changeset
49 > topic-mode = warning
cc740c545776 topicmode: add new warning topicmode
Boris Feld <boris.feld@octobus.net>
parents:
diff changeset
50 > EOF
cc740c545776 topicmode: add new warning topicmode
Boris Feld <boris.feld@octobus.net>
parents:
diff changeset
51 $ touch a b c d
cc740c545776 topicmode: add new warning topicmode
Boris Feld <boris.feld@octobus.net>
parents:
diff changeset
52 $ hg add a
cc740c545776 topicmode: add new warning topicmode
Boris Feld <boris.feld@octobus.net>
parents:
diff changeset
53 $ hg ci -m "Added a"
cc740c545776 topicmode: add new warning topicmode
Boris Feld <boris.feld@octobus.net>
parents:
diff changeset
54 warning: new draft commit without topic
3027
b220e2f5ebd5 topic: update the topic-mode hint
Pierre-Yves David <pierre-yves.david@octobus.net>
parents: 3025
diff changeset
55 (see 'hg help -e topic.topic-mode' for details) (no-eol)
3023
cc740c545776 topicmode: add new warning topicmode
Boris Feld <boris.feld@octobus.net>
parents:
diff changeset
56
cc740c545776 topicmode: add new warning topicmode
Boris Feld <boris.feld@octobus.net>
parents:
diff changeset
57 (same test, checking we abort before the editor)
cc740c545776 topicmode: add new warning topicmode
Boris Feld <boris.feld@octobus.net>
parents:
diff changeset
58
cc740c545776 topicmode: add new warning topicmode
Boris Feld <boris.feld@octobus.net>
parents:
diff changeset
59 $ EDITOR=cat hg ci --amend -m "Added a" --edit
cc740c545776 topicmode: add new warning topicmode
Boris Feld <boris.feld@octobus.net>
parents:
diff changeset
60 warning: new draft commit without topic
3027
b220e2f5ebd5 topic: update the topic-mode hint
Pierre-Yves David <pierre-yves.david@octobus.net>
parents: 3025
diff changeset
61 (see 'hg help -e topic.topic-mode' for details) (no-eol)
3023
cc740c545776 topicmode: add new warning topicmode
Boris Feld <boris.feld@octobus.net>
parents:
diff changeset
62 $ hg ci --amend -m "added a'" --config experimental.topic-mode=off
cc740c545776 topicmode: add new warning topicmode
Boris Feld <boris.feld@octobus.net>
parents:
diff changeset
63 $ hg log
cc740c545776 topicmode: add new warning topicmode
Boris Feld <boris.feld@octobus.net>
parents:
diff changeset
64 changeset: 2:2e862d8b5eff
cc740c545776 topicmode: add new warning topicmode
Boris Feld <boris.feld@octobus.net>
parents:
diff changeset
65 tag: tip
cc740c545776 topicmode: add new warning topicmode
Boris Feld <boris.feld@octobus.net>
parents:
diff changeset
66 parent: -1:000000000000
cc740c545776 topicmode: add new warning topicmode
Boris Feld <boris.feld@octobus.net>
parents:
diff changeset
67 user: test
cc740c545776 topicmode: add new warning topicmode
Boris Feld <boris.feld@octobus.net>
parents:
diff changeset
68 date: Thu Jan 01 00:00:00 1970 +0000
cc740c545776 topicmode: add new warning topicmode
Boris Feld <boris.feld@octobus.net>
parents:
diff changeset
69 summary: added a'
cc740c545776 topicmode: add new warning topicmode
Boris Feld <boris.feld@octobus.net>
parents:
diff changeset
70
3024
89855920fb0f topicmode: 'enforce' topic mode, no longer warn about untopiced merge
Boris Feld <boris.feld@octobus.net>
parents: 3023
diff changeset
71
89855920fb0f topicmode: 'enforce' topic mode, no longer warn about untopiced merge
Boris Feld <boris.feld@octobus.net>
parents: 3023
diff changeset
72 Testing the new config knob to warn about untopiced merge commit
89855920fb0f topicmode: 'enforce' topic mode, no longer warn about untopiced merge
Boris Feld <boris.feld@octobus.net>
parents: 3023
diff changeset
73 ================================================================
89855920fb0f topicmode: 'enforce' topic mode, no longer warn about untopiced merge
Boris Feld <boris.feld@octobus.net>
parents: 3023
diff changeset
74
89855920fb0f topicmode: 'enforce' topic mode, no longer warn about untopiced merge
Boris Feld <boris.feld@octobus.net>
parents: 3023
diff changeset
75 $ hg init $TESTTMP/test-untopic-merge-commit
89855920fb0f topicmode: 'enforce' topic mode, no longer warn about untopiced merge
Boris Feld <boris.feld@octobus.net>
parents: 3023
diff changeset
76 $ cd $TESTTMP/test-untopic-merge-commit
89855920fb0f topicmode: 'enforce' topic mode, no longer warn about untopiced merge
Boris Feld <boris.feld@octobus.net>
parents: 3023
diff changeset
77 $ cat <<EOF >> .hg/hgrc
89855920fb0f topicmode: 'enforce' topic mode, no longer warn about untopiced merge
Boris Feld <boris.feld@octobus.net>
parents: 3023
diff changeset
78 > [phases]
89855920fb0f topicmode: 'enforce' topic mode, no longer warn about untopiced merge
Boris Feld <boris.feld@octobus.net>
parents: 3023
diff changeset
79 > publish=false
89855920fb0f topicmode: 'enforce' topic mode, no longer warn about untopiced merge
Boris Feld <boris.feld@octobus.net>
parents: 3023
diff changeset
80 > EOF
89855920fb0f topicmode: 'enforce' topic mode, no longer warn about untopiced merge
Boris Feld <boris.feld@octobus.net>
parents: 3023
diff changeset
81 $ cat <<EOF >> $HGRCPATH
89855920fb0f topicmode: 'enforce' topic mode, no longer warn about untopiced merge
Boris Feld <boris.feld@octobus.net>
parents: 3023
diff changeset
82 > [experimental]
89855920fb0f topicmode: 'enforce' topic mode, no longer warn about untopiced merge
Boris Feld <boris.feld@octobus.net>
parents: 3023
diff changeset
83 > topic-mode = enforce
89855920fb0f topicmode: 'enforce' topic mode, no longer warn about untopiced merge
Boris Feld <boris.feld@octobus.net>
parents: 3023
diff changeset
84 > EOF
89855920fb0f topicmode: 'enforce' topic mode, no longer warn about untopiced merge
Boris Feld <boris.feld@octobus.net>
parents: 3023
diff changeset
85 $ touch ROOT
89855920fb0f topicmode: 'enforce' topic mode, no longer warn about untopiced merge
Boris Feld <boris.feld@octobus.net>
parents: 3023
diff changeset
86 $ hg commit -A -m "ROOT" --config experimental.topic-mode=off
89855920fb0f topicmode: 'enforce' topic mode, no longer warn about untopiced merge
Boris Feld <boris.feld@octobus.net>
parents: 3023
diff changeset
87 adding ROOT
89855920fb0f topicmode: 'enforce' topic mode, no longer warn about untopiced merge
Boris Feld <boris.feld@octobus.net>
parents: 3023
diff changeset
88 $ touch a
89855920fb0f topicmode: 'enforce' topic mode, no longer warn about untopiced merge
Boris Feld <boris.feld@octobus.net>
parents: 3023
diff changeset
89 $ hg add a
89855920fb0f topicmode: 'enforce' topic mode, no longer warn about untopiced merge
Boris Feld <boris.feld@octobus.net>
parents: 3023
diff changeset
90 $ hg topic mytopic
89855920fb0f topicmode: 'enforce' topic mode, no longer warn about untopiced merge
Boris Feld <boris.feld@octobus.net>
parents: 3023
diff changeset
91 marked working directory as topic: mytopic
89855920fb0f topicmode: 'enforce' topic mode, no longer warn about untopiced merge
Boris Feld <boris.feld@octobus.net>
parents: 3023
diff changeset
92 $ hg ci -m "Added a"
89855920fb0f topicmode: 'enforce' topic mode, no longer warn about untopiced merge
Boris Feld <boris.feld@octobus.net>
parents: 3023
diff changeset
93 active topic 'mytopic' grew its first changeset
89855920fb0f topicmode: 'enforce' topic mode, no longer warn about untopiced merge
Boris Feld <boris.feld@octobus.net>
parents: 3023
diff changeset
94
89855920fb0f topicmode: 'enforce' topic mode, no longer warn about untopiced merge
Boris Feld <boris.feld@octobus.net>
parents: 3023
diff changeset
95 $ hg up -r "desc('ROOT')"
89855920fb0f topicmode: 'enforce' topic mode, no longer warn about untopiced merge
Boris Feld <boris.feld@octobus.net>
parents: 3023
diff changeset
96 0 files updated, 0 files merged, 1 files removed, 0 files unresolved
89855920fb0f topicmode: 'enforce' topic mode, no longer warn about untopiced merge
Boris Feld <boris.feld@octobus.net>
parents: 3023
diff changeset
97 $ touch default
89855920fb0f topicmode: 'enforce' topic mode, no longer warn about untopiced merge
Boris Feld <boris.feld@octobus.net>
parents: 3023
diff changeset
98 $ hg add default
89855920fb0f topicmode: 'enforce' topic mode, no longer warn about untopiced merge
Boris Feld <boris.feld@octobus.net>
parents: 3023
diff changeset
99 $ hg commit -m "default" --config experimental.topic-mode=off
89855920fb0f topicmode: 'enforce' topic mode, no longer warn about untopiced merge
Boris Feld <boris.feld@octobus.net>
parents: 3023
diff changeset
100
89855920fb0f topicmode: 'enforce' topic mode, no longer warn about untopiced merge
Boris Feld <boris.feld@octobus.net>
parents: 3023
diff changeset
101 $ hg merge mytopic
89855920fb0f topicmode: 'enforce' topic mode, no longer warn about untopiced merge
Boris Feld <boris.feld@octobus.net>
parents: 3023
diff changeset
102 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
89855920fb0f topicmode: 'enforce' topic mode, no longer warn about untopiced merge
Boris Feld <boris.feld@octobus.net>
parents: 3023
diff changeset
103 (branch merge, don't forget to commit)
89855920fb0f topicmode: 'enforce' topic mode, no longer warn about untopiced merge
Boris Feld <boris.feld@octobus.net>
parents: 3023
diff changeset
104 $ hg commit -m "merge mytopic"
89855920fb0f topicmode: 'enforce' topic mode, no longer warn about untopiced merge
Boris Feld <boris.feld@octobus.net>
parents: 3023
diff changeset
105 warning: new draft commit without topic
3027
b220e2f5ebd5 topic: update the topic-mode hint
Pierre-Yves David <pierre-yves.david@octobus.net>
parents: 3025
diff changeset
106 (see 'hg help -e topic.topic-mode' for details) (no-eol)
3024
89855920fb0f topicmode: 'enforce' topic mode, no longer warn about untopiced merge
Boris Feld <boris.feld@octobus.net>
parents: 3023
diff changeset
107
89855920fb0f topicmode: 'enforce' topic mode, no longer warn about untopiced merge
Boris Feld <boris.feld@octobus.net>
parents: 3023
diff changeset
108 $ hg log -G
89855920fb0f topicmode: 'enforce' topic mode, no longer warn about untopiced merge
Boris Feld <boris.feld@octobus.net>
parents: 3023
diff changeset
109 @ changeset: 3:676a445d1c09
89855920fb0f topicmode: 'enforce' topic mode, no longer warn about untopiced merge
Boris Feld <boris.feld@octobus.net>
parents: 3023
diff changeset
110 |\ tag: tip
89855920fb0f topicmode: 'enforce' topic mode, no longer warn about untopiced merge
Boris Feld <boris.feld@octobus.net>
parents: 3023
diff changeset
111 | | parent: 2:a4da109ee59f
89855920fb0f topicmode: 'enforce' topic mode, no longer warn about untopiced merge
Boris Feld <boris.feld@octobus.net>
parents: 3023
diff changeset
112 | | parent: 1:e5b6c632bd8e
89855920fb0f topicmode: 'enforce' topic mode, no longer warn about untopiced merge
Boris Feld <boris.feld@octobus.net>
parents: 3023
diff changeset
113 | | user: test
89855920fb0f topicmode: 'enforce' topic mode, no longer warn about untopiced merge
Boris Feld <boris.feld@octobus.net>
parents: 3023
diff changeset
114 | | date: Thu Jan 01 00:00:00 1970 +0000
89855920fb0f topicmode: 'enforce' topic mode, no longer warn about untopiced merge
Boris Feld <boris.feld@octobus.net>
parents: 3023
diff changeset
115 | | summary: merge mytopic
89855920fb0f topicmode: 'enforce' topic mode, no longer warn about untopiced merge
Boris Feld <boris.feld@octobus.net>
parents: 3023
diff changeset
116 | |
89855920fb0f topicmode: 'enforce' topic mode, no longer warn about untopiced merge
Boris Feld <boris.feld@octobus.net>
parents: 3023
diff changeset
117 | o changeset: 2:a4da109ee59f
89855920fb0f topicmode: 'enforce' topic mode, no longer warn about untopiced merge
Boris Feld <boris.feld@octobus.net>
parents: 3023
diff changeset
118 | | parent: 0:ec1d2790416d
89855920fb0f topicmode: 'enforce' topic mode, no longer warn about untopiced merge
Boris Feld <boris.feld@octobus.net>
parents: 3023
diff changeset
119 | | user: test
89855920fb0f topicmode: 'enforce' topic mode, no longer warn about untopiced merge
Boris Feld <boris.feld@octobus.net>
parents: 3023
diff changeset
120 | | date: Thu Jan 01 00:00:00 1970 +0000
89855920fb0f topicmode: 'enforce' topic mode, no longer warn about untopiced merge
Boris Feld <boris.feld@octobus.net>
parents: 3023
diff changeset
121 | | summary: default
89855920fb0f topicmode: 'enforce' topic mode, no longer warn about untopiced merge
Boris Feld <boris.feld@octobus.net>
parents: 3023
diff changeset
122 | |
89855920fb0f topicmode: 'enforce' topic mode, no longer warn about untopiced merge
Boris Feld <boris.feld@octobus.net>
parents: 3023
diff changeset
123 o | changeset: 1:e5b6c632bd8e
89855920fb0f topicmode: 'enforce' topic mode, no longer warn about untopiced merge
Boris Feld <boris.feld@octobus.net>
parents: 3023
diff changeset
124 |/ topic: mytopic
89855920fb0f topicmode: 'enforce' topic mode, no longer warn about untopiced merge
Boris Feld <boris.feld@octobus.net>
parents: 3023
diff changeset
125 | user: test
89855920fb0f topicmode: 'enforce' topic mode, no longer warn about untopiced merge
Boris Feld <boris.feld@octobus.net>
parents: 3023
diff changeset
126 | date: Thu Jan 01 00:00:00 1970 +0000
89855920fb0f topicmode: 'enforce' topic mode, no longer warn about untopiced merge
Boris Feld <boris.feld@octobus.net>
parents: 3023
diff changeset
127 | summary: Added a
89855920fb0f topicmode: 'enforce' topic mode, no longer warn about untopiced merge
Boris Feld <boris.feld@octobus.net>
parents: 3023
diff changeset
128 |
89855920fb0f topicmode: 'enforce' topic mode, no longer warn about untopiced merge
Boris Feld <boris.feld@octobus.net>
parents: 3023
diff changeset
129 o changeset: 0:ec1d2790416d
89855920fb0f topicmode: 'enforce' topic mode, no longer warn about untopiced merge
Boris Feld <boris.feld@octobus.net>
parents: 3023
diff changeset
130 user: test
89855920fb0f topicmode: 'enforce' topic mode, no longer warn about untopiced merge
Boris Feld <boris.feld@octobus.net>
parents: 3023
diff changeset
131 date: Thu Jan 01 00:00:00 1970 +0000
89855920fb0f topicmode: 'enforce' topic mode, no longer warn about untopiced merge
Boris Feld <boris.feld@octobus.net>
parents: 3023
diff changeset
132 summary: ROOT
89855920fb0f topicmode: 'enforce' topic mode, no longer warn about untopiced merge
Boris Feld <boris.feld@octobus.net>
parents: 3023
diff changeset
133
3025
e814c553ef32 topic: add a 'enforce-all' mode
Pierre-Yves David <pierre-yves.david@octobus.net>
parents: 3024
diff changeset
134
e814c553ef32 topic: add a 'enforce-all' mode
Pierre-Yves David <pierre-yves.david@octobus.net>
parents: 3024
diff changeset
135 Testing the config knob to about on untopiced merge commit
e814c553ef32 topic: add a 'enforce-all' mode
Pierre-Yves David <pierre-yves.david@octobus.net>
parents: 3024
diff changeset
136 ================================================================
e814c553ef32 topic: add a 'enforce-all' mode
Pierre-Yves David <pierre-yves.david@octobus.net>
parents: 3024
diff changeset
137
e814c553ef32 topic: add a 'enforce-all' mode
Pierre-Yves David <pierre-yves.david@octobus.net>
parents: 3024
diff changeset
138 $ hg init $TESTTMP/test-untopic-merge-commit-abort
e814c553ef32 topic: add a 'enforce-all' mode
Pierre-Yves David <pierre-yves.david@octobus.net>
parents: 3024
diff changeset
139 $ cd $TESTTMP/test-untopic-merge-commit-abort
e814c553ef32 topic: add a 'enforce-all' mode
Pierre-Yves David <pierre-yves.david@octobus.net>
parents: 3024
diff changeset
140 $ cat <<EOF >> .hg/hgrc
e814c553ef32 topic: add a 'enforce-all' mode
Pierre-Yves David <pierre-yves.david@octobus.net>
parents: 3024
diff changeset
141 > [phases]
e814c553ef32 topic: add a 'enforce-all' mode
Pierre-Yves David <pierre-yves.david@octobus.net>
parents: 3024
diff changeset
142 > publish=false
e814c553ef32 topic: add a 'enforce-all' mode
Pierre-Yves David <pierre-yves.david@octobus.net>
parents: 3024
diff changeset
143 > EOF
e814c553ef32 topic: add a 'enforce-all' mode
Pierre-Yves David <pierre-yves.david@octobus.net>
parents: 3024
diff changeset
144 $ cat <<EOF >> $HGRCPATH
e814c553ef32 topic: add a 'enforce-all' mode
Pierre-Yves David <pierre-yves.david@octobus.net>
parents: 3024
diff changeset
145 > [experimental]
e814c553ef32 topic: add a 'enforce-all' mode
Pierre-Yves David <pierre-yves.david@octobus.net>
parents: 3024
diff changeset
146 > topic-mode = enforce-all
e814c553ef32 topic: add a 'enforce-all' mode
Pierre-Yves David <pierre-yves.david@octobus.net>
parents: 3024
diff changeset
147 > EOF
e814c553ef32 topic: add a 'enforce-all' mode
Pierre-Yves David <pierre-yves.david@octobus.net>
parents: 3024
diff changeset
148 $ touch ROOT
e814c553ef32 topic: add a 'enforce-all' mode
Pierre-Yves David <pierre-yves.david@octobus.net>
parents: 3024
diff changeset
149 $ hg commit -A -m "ROOT" --config experimental.topic-mode=off
e814c553ef32 topic: add a 'enforce-all' mode
Pierre-Yves David <pierre-yves.david@octobus.net>
parents: 3024
diff changeset
150 adding ROOT
e814c553ef32 topic: add a 'enforce-all' mode
Pierre-Yves David <pierre-yves.david@octobus.net>
parents: 3024
diff changeset
151 $ touch a
e814c553ef32 topic: add a 'enforce-all' mode
Pierre-Yves David <pierre-yves.david@octobus.net>
parents: 3024
diff changeset
152 $ hg add a
e814c553ef32 topic: add a 'enforce-all' mode
Pierre-Yves David <pierre-yves.david@octobus.net>
parents: 3024
diff changeset
153 $ hg topic mytopic
e814c553ef32 topic: add a 'enforce-all' mode
Pierre-Yves David <pierre-yves.david@octobus.net>
parents: 3024
diff changeset
154 marked working directory as topic: mytopic
e814c553ef32 topic: add a 'enforce-all' mode
Pierre-Yves David <pierre-yves.david@octobus.net>
parents: 3024
diff changeset
155 $ hg ci -m "Added a"
e814c553ef32 topic: add a 'enforce-all' mode
Pierre-Yves David <pierre-yves.david@octobus.net>
parents: 3024
diff changeset
156 active topic 'mytopic' grew its first changeset
e814c553ef32 topic: add a 'enforce-all' mode
Pierre-Yves David <pierre-yves.david@octobus.net>
parents: 3024
diff changeset
157
e814c553ef32 topic: add a 'enforce-all' mode
Pierre-Yves David <pierre-yves.david@octobus.net>
parents: 3024
diff changeset
158 $ hg up -r "desc('ROOT')"
e814c553ef32 topic: add a 'enforce-all' mode
Pierre-Yves David <pierre-yves.david@octobus.net>
parents: 3024
diff changeset
159 0 files updated, 0 files merged, 1 files removed, 0 files unresolved
e814c553ef32 topic: add a 'enforce-all' mode
Pierre-Yves David <pierre-yves.david@octobus.net>
parents: 3024
diff changeset
160 $ touch default
e814c553ef32 topic: add a 'enforce-all' mode
Pierre-Yves David <pierre-yves.david@octobus.net>
parents: 3024
diff changeset
161 $ hg add default
e814c553ef32 topic: add a 'enforce-all' mode
Pierre-Yves David <pierre-yves.david@octobus.net>
parents: 3024
diff changeset
162 $ hg commit -m "default" --config experimental.topic-mode=off
e814c553ef32 topic: add a 'enforce-all' mode
Pierre-Yves David <pierre-yves.david@octobus.net>
parents: 3024
diff changeset
163
e814c553ef32 topic: add a 'enforce-all' mode
Pierre-Yves David <pierre-yves.david@octobus.net>
parents: 3024
diff changeset
164 $ hg merge mytopic
e814c553ef32 topic: add a 'enforce-all' mode
Pierre-Yves David <pierre-yves.david@octobus.net>
parents: 3024
diff changeset
165 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
e814c553ef32 topic: add a 'enforce-all' mode
Pierre-Yves David <pierre-yves.david@octobus.net>
parents: 3024
diff changeset
166 (branch merge, don't forget to commit)
e814c553ef32 topic: add a 'enforce-all' mode
Pierre-Yves David <pierre-yves.david@octobus.net>
parents: 3024
diff changeset
167 $ hg commit -m "merge mytopic"
e814c553ef32 topic: add a 'enforce-all' mode
Pierre-Yves David <pierre-yves.david@octobus.net>
parents: 3024
diff changeset
168 abort: no active topic
3027
b220e2f5ebd5 topic: update the topic-mode hint
Pierre-Yves David <pierre-yves.david@octobus.net>
parents: 3025
diff changeset
169 (see 'hg help -e topic.topic-mode' for details)
3025
e814c553ef32 topic: add a 'enforce-all' mode
Pierre-Yves David <pierre-yves.david@octobus.net>
parents: 3024
diff changeset
170 [255]
e814c553ef32 topic: add a 'enforce-all' mode
Pierre-Yves David <pierre-yves.david@octobus.net>
parents: 3024
diff changeset
171
e814c553ef32 topic: add a 'enforce-all' mode
Pierre-Yves David <pierre-yves.david@octobus.net>
parents: 3024
diff changeset
172 $ hg log -G
e814c553ef32 topic: add a 'enforce-all' mode
Pierre-Yves David <pierre-yves.david@octobus.net>
parents: 3024
diff changeset
173 @ changeset: 2:a4da109ee59f
e814c553ef32 topic: add a 'enforce-all' mode
Pierre-Yves David <pierre-yves.david@octobus.net>
parents: 3024
diff changeset
174 | tag: tip
e814c553ef32 topic: add a 'enforce-all' mode
Pierre-Yves David <pierre-yves.david@octobus.net>
parents: 3024
diff changeset
175 | parent: 0:ec1d2790416d
e814c553ef32 topic: add a 'enforce-all' mode
Pierre-Yves David <pierre-yves.david@octobus.net>
parents: 3024
diff changeset
176 | user: test
e814c553ef32 topic: add a 'enforce-all' mode
Pierre-Yves David <pierre-yves.david@octobus.net>
parents: 3024
diff changeset
177 | date: Thu Jan 01 00:00:00 1970 +0000
e814c553ef32 topic: add a 'enforce-all' mode
Pierre-Yves David <pierre-yves.david@octobus.net>
parents: 3024
diff changeset
178 | summary: default
e814c553ef32 topic: add a 'enforce-all' mode
Pierre-Yves David <pierre-yves.david@octobus.net>
parents: 3024
diff changeset
179 |
e814c553ef32 topic: add a 'enforce-all' mode
Pierre-Yves David <pierre-yves.david@octobus.net>
parents: 3024
diff changeset
180 | @ changeset: 1:e5b6c632bd8e
e814c553ef32 topic: add a 'enforce-all' mode
Pierre-Yves David <pierre-yves.david@octobus.net>
parents: 3024
diff changeset
181 |/ topic: mytopic
e814c553ef32 topic: add a 'enforce-all' mode
Pierre-Yves David <pierre-yves.david@octobus.net>
parents: 3024
diff changeset
182 | user: test
e814c553ef32 topic: add a 'enforce-all' mode
Pierre-Yves David <pierre-yves.david@octobus.net>
parents: 3024
diff changeset
183 | date: Thu Jan 01 00:00:00 1970 +0000
e814c553ef32 topic: add a 'enforce-all' mode
Pierre-Yves David <pierre-yves.david@octobus.net>
parents: 3024
diff changeset
184 | summary: Added a
e814c553ef32 topic: add a 'enforce-all' mode
Pierre-Yves David <pierre-yves.david@octobus.net>
parents: 3024
diff changeset
185 |
e814c553ef32 topic: add a 'enforce-all' mode
Pierre-Yves David <pierre-yves.david@octobus.net>
parents: 3024
diff changeset
186 o changeset: 0:ec1d2790416d
e814c553ef32 topic: add a 'enforce-all' mode
Pierre-Yves David <pierre-yves.david@octobus.net>
parents: 3024
diff changeset
187 user: test
e814c553ef32 topic: add a 'enforce-all' mode
Pierre-Yves David <pierre-yves.david@octobus.net>
parents: 3024
diff changeset
188 date: Thu Jan 01 00:00:00 1970 +0000
e814c553ef32 topic: add a 'enforce-all' mode
Pierre-Yves David <pierre-yves.david@octobus.net>
parents: 3024
diff changeset
189 summary: ROOT
e814c553ef32 topic: add a 'enforce-all' mode
Pierre-Yves David <pierre-yves.david@octobus.net>
parents: 3024
diff changeset
190
3028
c2d1f49ac7e2 topicmode: add 'random' topic mode
Boris Feld <boris.feld@octobus.net>
parents: 3027
diff changeset
191 Testing the new config knob to use a random topic for untopic commit
c2d1f49ac7e2 topicmode: add 'random' topic mode
Boris Feld <boris.feld@octobus.net>
parents: 3027
diff changeset
192 ====================================================================
c2d1f49ac7e2 topicmode: add 'random' topic mode
Boris Feld <boris.feld@octobus.net>
parents: 3027
diff changeset
193
c2d1f49ac7e2 topicmode: add 'random' topic mode
Boris Feld <boris.feld@octobus.net>
parents: 3027
diff changeset
194 $ hg init $TESTTMP/test-untopic-random
c2d1f49ac7e2 topicmode: add 'random' topic mode
Boris Feld <boris.feld@octobus.net>
parents: 3027
diff changeset
195 $ cd $TESTTMP/test-untopic-random
c2d1f49ac7e2 topicmode: add 'random' topic mode
Boris Feld <boris.feld@octobus.net>
parents: 3027
diff changeset
196 $ cat <<EOF >> .hg/hgrc
c2d1f49ac7e2 topicmode: add 'random' topic mode
Boris Feld <boris.feld@octobus.net>
parents: 3027
diff changeset
197 > [phases]
c2d1f49ac7e2 topicmode: add 'random' topic mode
Boris Feld <boris.feld@octobus.net>
parents: 3027
diff changeset
198 > publish=false
c2d1f49ac7e2 topicmode: add 'random' topic mode
Boris Feld <boris.feld@octobus.net>
parents: 3027
diff changeset
199 > EOF
c2d1f49ac7e2 topicmode: add 'random' topic mode
Boris Feld <boris.feld@octobus.net>
parents: 3027
diff changeset
200 $ cat <<EOF >> $HGRCPATH
c2d1f49ac7e2 topicmode: add 'random' topic mode
Boris Feld <boris.feld@octobus.net>
parents: 3027
diff changeset
201 > [experimental]
c2d1f49ac7e2 topicmode: add 'random' topic mode
Boris Feld <boris.feld@octobus.net>
parents: 3027
diff changeset
202 > topic-mode = random
c2d1f49ac7e2 topicmode: add 'random' topic mode
Boris Feld <boris.feld@octobus.net>
parents: 3027
diff changeset
203 > EOF
c2d1f49ac7e2 topicmode: add 'random' topic mode
Boris Feld <boris.feld@octobus.net>
parents: 3027
diff changeset
204
c2d1f49ac7e2 topicmode: add 'random' topic mode
Boris Feld <boris.feld@octobus.net>
parents: 3027
diff changeset
205 $ touch ROOT
c2d1f49ac7e2 topicmode: add 'random' topic mode
Boris Feld <boris.feld@octobus.net>
parents: 3027
diff changeset
206 $ hg commit -A -m "ROOT" --config experimental.topic-mode=off
c2d1f49ac7e2 topicmode: add 'random' topic mode
Boris Feld <boris.feld@octobus.net>
parents: 3027
diff changeset
207 adding ROOT
c2d1f49ac7e2 topicmode: add 'random' topic mode
Boris Feld <boris.feld@octobus.net>
parents: 3027
diff changeset
208
c2d1f49ac7e2 topicmode: add 'random' topic mode
Boris Feld <boris.feld@octobus.net>
parents: 3027
diff changeset
209 $ touch A
c2d1f49ac7e2 topicmode: add 'random' topic mode
Boris Feld <boris.feld@octobus.net>
parents: 3027
diff changeset
210 $ hg add A
c2d1f49ac7e2 topicmode: add 'random' topic mode
Boris Feld <boris.feld@octobus.net>
parents: 3027
diff changeset
211 $ hg commit -m "Add A" --config devel.randomseed=42
c2d1f49ac7e2 topicmode: add 'random' topic mode
Boris Feld <boris.feld@octobus.net>
parents: 3027
diff changeset
212 active topic 'panoramic-antelope' grew its first changeset
c2d1f49ac7e2 topicmode: add 'random' topic mode
Boris Feld <boris.feld@octobus.net>
parents: 3027
diff changeset
213
c2d1f49ac7e2 topicmode: add 'random' topic mode
Boris Feld <boris.feld@octobus.net>
parents: 3027
diff changeset
214 $ hg up -r "desc(ROOT)"
c2d1f49ac7e2 topicmode: add 'random' topic mode
Boris Feld <boris.feld@octobus.net>
parents: 3027
diff changeset
215 0 files updated, 0 files merged, 1 files removed, 0 files unresolved
c2d1f49ac7e2 topicmode: add 'random' topic mode
Boris Feld <boris.feld@octobus.net>
parents: 3027
diff changeset
216
c2d1f49ac7e2 topicmode: add 'random' topic mode
Boris Feld <boris.feld@octobus.net>
parents: 3027
diff changeset
217 $ touch B
c2d1f49ac7e2 topicmode: add 'random' topic mode
Boris Feld <boris.feld@octobus.net>
parents: 3027
diff changeset
218 $ hg add B
c2d1f49ac7e2 topicmode: add 'random' topic mode
Boris Feld <boris.feld@octobus.net>
parents: 3027
diff changeset
219 $ hg commit -m "Add B" --config devel.randomseed=128
c2d1f49ac7e2 topicmode: add 'random' topic mode
Boris Feld <boris.feld@octobus.net>
parents: 3027
diff changeset
220 active topic 'various-dove' grew its first changeset