annotate tests/test-topicmode.t @ 3024:89855920fb0f

topicmode: 'enforce' topic mode, no longer warn about untopiced merge merging a topic back in a branch is common case, it seems sensible to not pester the user about it.
author Boris Feld <boris.feld@octobus.net>
date Sat, 30 Sep 2017 23:18:29 +0100
parents cc740c545776
children e814c553ef32
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
cc740c545776 topicmode: add new warning topicmode
Boris Feld <boris.feld@octobus.net>
parents:
diff changeset
20 (set a current topic or use '--config experimental.topic-mode=off' to commit without a topic)
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
cc740c545776 topicmode: add new warning topicmode
Boris Feld <boris.feld@octobus.net>
parents:
diff changeset
27 (set a current topic or use '--config experimental.topic-mode=off' to commit without a topic)
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
cc740c545776 topicmode: add new warning topicmode
Boris Feld <boris.feld@octobus.net>
parents:
diff changeset
55
cc740c545776 topicmode: add new warning topicmode
Boris Feld <boris.feld@octobus.net>
parents:
diff changeset
56 (same test, checking we abort before the editor)
cc740c545776 topicmode: add new warning topicmode
Boris Feld <boris.feld@octobus.net>
parents:
diff changeset
57
cc740c545776 topicmode: add new warning topicmode
Boris Feld <boris.feld@octobus.net>
parents:
diff changeset
58 $ EDITOR=cat hg ci --amend -m "Added a" --edit
cc740c545776 topicmode: add new warning topicmode
Boris Feld <boris.feld@octobus.net>
parents:
diff changeset
59 warning: new draft commit without topic
cc740c545776 topicmode: add new warning topicmode
Boris Feld <boris.feld@octobus.net>
parents:
diff changeset
60 $ 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
61 $ hg log
cc740c545776 topicmode: add new warning topicmode
Boris Feld <boris.feld@octobus.net>
parents:
diff changeset
62 changeset: 2:2e862d8b5eff
cc740c545776 topicmode: add new warning topicmode
Boris Feld <boris.feld@octobus.net>
parents:
diff changeset
63 tag: tip
cc740c545776 topicmode: add new warning topicmode
Boris Feld <boris.feld@octobus.net>
parents:
diff changeset
64 parent: -1:000000000000
cc740c545776 topicmode: add new warning topicmode
Boris Feld <boris.feld@octobus.net>
parents:
diff changeset
65 user: test
cc740c545776 topicmode: add new warning topicmode
Boris Feld <boris.feld@octobus.net>
parents:
diff changeset
66 date: Thu Jan 01 00:00:00 1970 +0000
cc740c545776 topicmode: add new warning topicmode
Boris Feld <boris.feld@octobus.net>
parents:
diff changeset
67 summary: added a'
cc740c545776 topicmode: add new warning topicmode
Boris Feld <boris.feld@octobus.net>
parents:
diff changeset
68
3024
89855920fb0f topicmode: 'enforce' topic mode, no longer warn about untopiced merge
Boris Feld <boris.feld@octobus.net>
parents: 3023
diff changeset
69
89855920fb0f topicmode: 'enforce' topic mode, no longer warn about untopiced merge
Boris Feld <boris.feld@octobus.net>
parents: 3023
diff changeset
70 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
71 ================================================================
89855920fb0f topicmode: 'enforce' topic mode, no longer warn about untopiced merge
Boris Feld <boris.feld@octobus.net>
parents: 3023
diff changeset
72
89855920fb0f topicmode: 'enforce' topic mode, no longer warn about untopiced merge
Boris Feld <boris.feld@octobus.net>
parents: 3023
diff changeset
73 $ 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
74 $ 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
75 $ 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
76 > [phases]
89855920fb0f topicmode: 'enforce' topic mode, no longer warn about untopiced merge
Boris Feld <boris.feld@octobus.net>
parents: 3023
diff changeset
77 > publish=false
89855920fb0f topicmode: 'enforce' topic mode, no longer warn about untopiced merge
Boris Feld <boris.feld@octobus.net>
parents: 3023
diff changeset
78 > EOF
89855920fb0f topicmode: 'enforce' topic mode, no longer warn about untopiced merge
Boris Feld <boris.feld@octobus.net>
parents: 3023
diff changeset
79 $ cat <<EOF >> $HGRCPATH
89855920fb0f topicmode: 'enforce' topic mode, no longer warn about untopiced merge
Boris Feld <boris.feld@octobus.net>
parents: 3023
diff changeset
80 > [experimental]
89855920fb0f topicmode: 'enforce' topic mode, no longer warn about untopiced merge
Boris Feld <boris.feld@octobus.net>
parents: 3023
diff changeset
81 > topic-mode = enforce
89855920fb0f topicmode: 'enforce' topic mode, no longer warn about untopiced merge
Boris Feld <boris.feld@octobus.net>
parents: 3023
diff changeset
82 > EOF
89855920fb0f topicmode: 'enforce' topic mode, no longer warn about untopiced merge
Boris Feld <boris.feld@octobus.net>
parents: 3023
diff changeset
83 $ touch ROOT
89855920fb0f topicmode: 'enforce' topic mode, no longer warn about untopiced merge
Boris Feld <boris.feld@octobus.net>
parents: 3023
diff changeset
84 $ 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
85 adding ROOT
89855920fb0f topicmode: 'enforce' topic mode, no longer warn about untopiced merge
Boris Feld <boris.feld@octobus.net>
parents: 3023
diff changeset
86 $ touch a
89855920fb0f topicmode: 'enforce' topic mode, no longer warn about untopiced merge
Boris Feld <boris.feld@octobus.net>
parents: 3023
diff changeset
87 $ hg add a
89855920fb0f topicmode: 'enforce' topic mode, no longer warn about untopiced merge
Boris Feld <boris.feld@octobus.net>
parents: 3023
diff changeset
88 $ hg topic mytopic
89855920fb0f topicmode: 'enforce' topic mode, no longer warn about untopiced merge
Boris Feld <boris.feld@octobus.net>
parents: 3023
diff changeset
89 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
90 $ 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
91 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
92
89855920fb0f topicmode: 'enforce' topic mode, no longer warn about untopiced merge
Boris Feld <boris.feld@octobus.net>
parents: 3023
diff changeset
93 $ 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
94 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
95 $ touch default
89855920fb0f topicmode: 'enforce' topic mode, no longer warn about untopiced merge
Boris Feld <boris.feld@octobus.net>
parents: 3023
diff changeset
96 $ hg add default
89855920fb0f topicmode: 'enforce' topic mode, no longer warn about untopiced merge
Boris Feld <boris.feld@octobus.net>
parents: 3023
diff changeset
97 $ 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
98
89855920fb0f topicmode: 'enforce' topic mode, no longer warn about untopiced merge
Boris Feld <boris.feld@octobus.net>
parents: 3023
diff changeset
99 $ hg merge mytopic
89855920fb0f topicmode: 'enforce' topic mode, no longer warn about untopiced merge
Boris Feld <boris.feld@octobus.net>
parents: 3023
diff changeset
100 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
101 (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
102 $ 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
103 warning: new draft commit without topic
89855920fb0f topicmode: 'enforce' topic mode, no longer warn about untopiced merge
Boris Feld <boris.feld@octobus.net>
parents: 3023
diff changeset
104
89855920fb0f topicmode: 'enforce' topic mode, no longer warn about untopiced merge
Boris Feld <boris.feld@octobus.net>
parents: 3023
diff changeset
105 $ hg log -G
89855920fb0f topicmode: 'enforce' topic mode, no longer warn about untopiced merge
Boris Feld <boris.feld@octobus.net>
parents: 3023
diff changeset
106 @ changeset: 3:676a445d1c09
89855920fb0f topicmode: 'enforce' topic mode, no longer warn about untopiced merge
Boris Feld <boris.feld@octobus.net>
parents: 3023
diff changeset
107 |\ tag: tip
89855920fb0f topicmode: 'enforce' topic mode, no longer warn about untopiced merge
Boris Feld <boris.feld@octobus.net>
parents: 3023
diff changeset
108 | | parent: 2:a4da109ee59f
89855920fb0f topicmode: 'enforce' topic mode, no longer warn about untopiced merge
Boris Feld <boris.feld@octobus.net>
parents: 3023
diff changeset
109 | | parent: 1:e5b6c632bd8e
89855920fb0f topicmode: 'enforce' topic mode, no longer warn about untopiced merge
Boris Feld <boris.feld@octobus.net>
parents: 3023
diff changeset
110 | | user: test
89855920fb0f topicmode: 'enforce' topic mode, no longer warn about untopiced merge
Boris Feld <boris.feld@octobus.net>
parents: 3023
diff changeset
111 | | 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
112 | | summary: merge mytopic
89855920fb0f topicmode: 'enforce' topic mode, no longer warn about untopiced merge
Boris Feld <boris.feld@octobus.net>
parents: 3023
diff changeset
113 | |
89855920fb0f topicmode: 'enforce' topic mode, no longer warn about untopiced merge
Boris Feld <boris.feld@octobus.net>
parents: 3023
diff changeset
114 | 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
115 | | parent: 0:ec1d2790416d
89855920fb0f topicmode: 'enforce' topic mode, no longer warn about untopiced merge
Boris Feld <boris.feld@octobus.net>
parents: 3023
diff changeset
116 | | user: test
89855920fb0f topicmode: 'enforce' topic mode, no longer warn about untopiced merge
Boris Feld <boris.feld@octobus.net>
parents: 3023
diff changeset
117 | | 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
118 | | summary: default
89855920fb0f topicmode: 'enforce' topic mode, no longer warn about untopiced merge
Boris Feld <boris.feld@octobus.net>
parents: 3023
diff changeset
119 | |
89855920fb0f topicmode: 'enforce' topic mode, no longer warn about untopiced merge
Boris Feld <boris.feld@octobus.net>
parents: 3023
diff changeset
120 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
121 |/ topic: mytopic
89855920fb0f topicmode: 'enforce' topic mode, no longer warn about untopiced merge
Boris Feld <boris.feld@octobus.net>
parents: 3023
diff changeset
122 | user: test
89855920fb0f topicmode: 'enforce' topic mode, no longer warn about untopiced merge
Boris Feld <boris.feld@octobus.net>
parents: 3023
diff changeset
123 | 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
124 | summary: Added a
89855920fb0f topicmode: 'enforce' topic mode, no longer warn about untopiced merge
Boris Feld <boris.feld@octobus.net>
parents: 3023
diff changeset
125 |
89855920fb0f topicmode: 'enforce' topic mode, no longer warn about untopiced merge
Boris Feld <boris.feld@octobus.net>
parents: 3023
diff changeset
126 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
127 user: test
89855920fb0f topicmode: 'enforce' topic mode, no longer warn about untopiced merge
Boris Feld <boris.feld@octobus.net>
parents: 3023
diff changeset
128 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
129 summary: ROOT
89855920fb0f topicmode: 'enforce' topic mode, no longer warn about untopiced merge
Boris Feld <boris.feld@octobus.net>
parents: 3023
diff changeset
130