Mercurial > evolve
annotate tests/test-topicmode.t @ 3023:cc740c545776
topicmode: add new warning topicmode
author | Boris Feld <boris.feld@octobus.net> |
---|---|
date | Sat, 30 Sep 2017 23:00:21 +0100 |
parents | |
children | 89855920fb0f |
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 |