Mercurial > evolve
annotate tests/test-topic-fold.t @ 2679:5156a67f66a6
topics: update current topic to the topic of newly rebased commit (issue5551)
The rebase code passes branchmerge equals to True while updating to the rebased
commit. We need to make sure topic is preserved even after rebase and hence we
need to update the topic even when branchmerge argument is set to True. But
there is a twist in the tale, merge also uses this part of code and we allow to
update topic when brancmerge is True, in merge cases the topic after merge will
the topic of the destination commit, not the topic of working directory parent.
So we need the function to have information about whether a rebase is going on,
and we do it by wrapping the rebase command and storing some value in the
config. This is a bit hacky but works for now. This patch fixes issue related to
loosing of topic while rebase.
Thanks to Boris Feld for the rigourous tests.
author | Pulkit Goyal <7895pulkit@gmail.com> |
---|---|
date | Thu, 29 Jun 2017 02:31:55 +0530 |
parents | 2d828f448081 |
children | f19b314d8475 |
rev | line source |
---|---|
2666
2d828f448081
topic: add tests for fold behavior with topics
Boris Feld <boris.feld@octobus.net>
parents:
diff
changeset
|
1 test of the fold command |
2d828f448081
topic: add tests for fold behavior with topics
Boris Feld <boris.feld@octobus.net>
parents:
diff
changeset
|
2 ------------------------ |
2d828f448081
topic: add tests for fold behavior with topics
Boris Feld <boris.feld@octobus.net>
parents:
diff
changeset
|
3 |
2d828f448081
topic: add tests for fold behavior with topics
Boris Feld <boris.feld@octobus.net>
parents:
diff
changeset
|
4 $ cat >> $HGRCPATH <<EOF |
2d828f448081
topic: add tests for fold behavior with topics
Boris Feld <boris.feld@octobus.net>
parents:
diff
changeset
|
5 > [defaults] |
2d828f448081
topic: add tests for fold behavior with topics
Boris Feld <boris.feld@octobus.net>
parents:
diff
changeset
|
6 > amend=-d "0 0" |
2d828f448081
topic: add tests for fold behavior with topics
Boris Feld <boris.feld@octobus.net>
parents:
diff
changeset
|
7 > fold=-d "0 0" |
2d828f448081
topic: add tests for fold behavior with topics
Boris Feld <boris.feld@octobus.net>
parents:
diff
changeset
|
8 > split=-d "0 0" |
2d828f448081
topic: add tests for fold behavior with topics
Boris Feld <boris.feld@octobus.net>
parents:
diff
changeset
|
9 > amend=-d "0 0" |
2d828f448081
topic: add tests for fold behavior with topics
Boris Feld <boris.feld@octobus.net>
parents:
diff
changeset
|
10 > [web] |
2d828f448081
topic: add tests for fold behavior with topics
Boris Feld <boris.feld@octobus.net>
parents:
diff
changeset
|
11 > push_ssl = false |
2d828f448081
topic: add tests for fold behavior with topics
Boris Feld <boris.feld@octobus.net>
parents:
diff
changeset
|
12 > allow_push = * |
2d828f448081
topic: add tests for fold behavior with topics
Boris Feld <boris.feld@octobus.net>
parents:
diff
changeset
|
13 > [phases] |
2d828f448081
topic: add tests for fold behavior with topics
Boris Feld <boris.feld@octobus.net>
parents:
diff
changeset
|
14 > publish = False |
2d828f448081
topic: add tests for fold behavior with topics
Boris Feld <boris.feld@octobus.net>
parents:
diff
changeset
|
15 > [diff] |
2d828f448081
topic: add tests for fold behavior with topics
Boris Feld <boris.feld@octobus.net>
parents:
diff
changeset
|
16 > git = 1 |
2d828f448081
topic: add tests for fold behavior with topics
Boris Feld <boris.feld@octobus.net>
parents:
diff
changeset
|
17 > unified = 0 |
2d828f448081
topic: add tests for fold behavior with topics
Boris Feld <boris.feld@octobus.net>
parents:
diff
changeset
|
18 > [ui] |
2d828f448081
topic: add tests for fold behavior with topics
Boris Feld <boris.feld@octobus.net>
parents:
diff
changeset
|
19 > interactive = true |
2d828f448081
topic: add tests for fold behavior with topics
Boris Feld <boris.feld@octobus.net>
parents:
diff
changeset
|
20 > [extensions] |
2d828f448081
topic: add tests for fold behavior with topics
Boris Feld <boris.feld@octobus.net>
parents:
diff
changeset
|
21 > hgext.graphlog= |
2d828f448081
topic: add tests for fold behavior with topics
Boris Feld <boris.feld@octobus.net>
parents:
diff
changeset
|
22 > EOF |
2d828f448081
topic: add tests for fold behavior with topics
Boris Feld <boris.feld@octobus.net>
parents:
diff
changeset
|
23 $ echo "topic=$(echo $(dirname $TESTDIR))/hgext3rd/topic/" >> $HGRCPATH |
2d828f448081
topic: add tests for fold behavior with topics
Boris Feld <boris.feld@octobus.net>
parents:
diff
changeset
|
24 $ echo "evolve=$(echo $(dirname $TESTDIR))/hgext3rd/evolve/" >> $HGRCPATH |
2d828f448081
topic: add tests for fold behavior with topics
Boris Feld <boris.feld@octobus.net>
parents:
diff
changeset
|
25 $ mkcommit() { |
2d828f448081
topic: add tests for fold behavior with topics
Boris Feld <boris.feld@octobus.net>
parents:
diff
changeset
|
26 > echo "$1" > "$1" |
2d828f448081
topic: add tests for fold behavior with topics
Boris Feld <boris.feld@octobus.net>
parents:
diff
changeset
|
27 > hg add "$1" |
2d828f448081
topic: add tests for fold behavior with topics
Boris Feld <boris.feld@octobus.net>
parents:
diff
changeset
|
28 > hg ci -m "add $1" $2 $3 |
2d828f448081
topic: add tests for fold behavior with topics
Boris Feld <boris.feld@octobus.net>
parents:
diff
changeset
|
29 > } |
2d828f448081
topic: add tests for fold behavior with topics
Boris Feld <boris.feld@octobus.net>
parents:
diff
changeset
|
30 $ logtopic() { |
2d828f448081
topic: add tests for fold behavior with topics
Boris Feld <boris.feld@octobus.net>
parents:
diff
changeset
|
31 > hg log -G -T "{rev}:{node}\ntopics: {topics}" |
2d828f448081
topic: add tests for fold behavior with topics
Boris Feld <boris.feld@octobus.net>
parents:
diff
changeset
|
32 > } |
2d828f448081
topic: add tests for fold behavior with topics
Boris Feld <boris.feld@octobus.net>
parents:
diff
changeset
|
33 |
2d828f448081
topic: add tests for fold behavior with topics
Boris Feld <boris.feld@octobus.net>
parents:
diff
changeset
|
34 Check that fold keep the topic if all revisions have the topic |
2d828f448081
topic: add tests for fold behavior with topics
Boris Feld <boris.feld@octobus.net>
parents:
diff
changeset
|
35 -------------------------------------------------------------- |
2d828f448081
topic: add tests for fold behavior with topics
Boris Feld <boris.feld@octobus.net>
parents:
diff
changeset
|
36 |
2d828f448081
topic: add tests for fold behavior with topics
Boris Feld <boris.feld@octobus.net>
parents:
diff
changeset
|
37 $ hg init testfold |
2d828f448081
topic: add tests for fold behavior with topics
Boris Feld <boris.feld@octobus.net>
parents:
diff
changeset
|
38 $ cd testfold |
2d828f448081
topic: add tests for fold behavior with topics
Boris Feld <boris.feld@octobus.net>
parents:
diff
changeset
|
39 $ mkcommit ROOT |
2d828f448081
topic: add tests for fold behavior with topics
Boris Feld <boris.feld@octobus.net>
parents:
diff
changeset
|
40 $ hg topic myfeature |
2d828f448081
topic: add tests for fold behavior with topics
Boris Feld <boris.feld@octobus.net>
parents:
diff
changeset
|
41 $ mkcommit feature1 |
2d828f448081
topic: add tests for fold behavior with topics
Boris Feld <boris.feld@octobus.net>
parents:
diff
changeset
|
42 $ mkcommit feature2 |
2d828f448081
topic: add tests for fold behavior with topics
Boris Feld <boris.feld@octobus.net>
parents:
diff
changeset
|
43 $ logtopic |
2d828f448081
topic: add tests for fold behavior with topics
Boris Feld <boris.feld@octobus.net>
parents:
diff
changeset
|
44 @ 2:d76a6166b18c835be9a487c5e21c7d260f0a1676 |
2d828f448081
topic: add tests for fold behavior with topics
Boris Feld <boris.feld@octobus.net>
parents:
diff
changeset
|
45 | topics: myfeature |
2d828f448081
topic: add tests for fold behavior with topics
Boris Feld <boris.feld@octobus.net>
parents:
diff
changeset
|
46 o 1:39e7a938055e87615edf675c24a10997ff05bb06 |
2d828f448081
topic: add tests for fold behavior with topics
Boris Feld <boris.feld@octobus.net>
parents:
diff
changeset
|
47 | topics: myfeature |
2d828f448081
topic: add tests for fold behavior with topics
Boris Feld <boris.feld@octobus.net>
parents:
diff
changeset
|
48 o 0:3e7df3b3b17c6deb4a1c70e790782fdf17af96a7 |
2d828f448081
topic: add tests for fold behavior with topics
Boris Feld <boris.feld@octobus.net>
parents:
diff
changeset
|
49 topics: |
2d828f448081
topic: add tests for fold behavior with topics
Boris Feld <boris.feld@octobus.net>
parents:
diff
changeset
|
50 $ hg fold --exact -r "(tip~1)::" -m "folded" |
2d828f448081
topic: add tests for fold behavior with topics
Boris Feld <boris.feld@octobus.net>
parents:
diff
changeset
|
51 2 changesets folded |
2d828f448081
topic: add tests for fold behavior with topics
Boris Feld <boris.feld@octobus.net>
parents:
diff
changeset
|
52 0 files updated, 0 files merged, 0 files removed, 0 files unresolved |
2d828f448081
topic: add tests for fold behavior with topics
Boris Feld <boris.feld@octobus.net>
parents:
diff
changeset
|
53 $ hg stack |
2d828f448081
topic: add tests for fold behavior with topics
Boris Feld <boris.feld@octobus.net>
parents:
diff
changeset
|
54 ### topic: myfeature |
2d828f448081
topic: add tests for fold behavior with topics
Boris Feld <boris.feld@octobus.net>
parents:
diff
changeset
|
55 ### branch: default |
2d828f448081
topic: add tests for fold behavior with topics
Boris Feld <boris.feld@octobus.net>
parents:
diff
changeset
|
56 t1@ folded (current) |
2d828f448081
topic: add tests for fold behavior with topics
Boris Feld <boris.feld@octobus.net>
parents:
diff
changeset
|
57 ^ add ROOT |
2d828f448081
topic: add tests for fold behavior with topics
Boris Feld <boris.feld@octobus.net>
parents:
diff
changeset
|
58 $ logtopic |
2d828f448081
topic: add tests for fold behavior with topics
Boris Feld <boris.feld@octobus.net>
parents:
diff
changeset
|
59 @ 3:4fd43e5bdc443dc8489edffac19bd8f93ccf1a5c |
2d828f448081
topic: add tests for fold behavior with topics
Boris Feld <boris.feld@octobus.net>
parents:
diff
changeset
|
60 | topics: myfeature |
2d828f448081
topic: add tests for fold behavior with topics
Boris Feld <boris.feld@octobus.net>
parents:
diff
changeset
|
61 o 0:3e7df3b3b17c6deb4a1c70e790782fdf17af96a7 |
2d828f448081
topic: add tests for fold behavior with topics
Boris Feld <boris.feld@octobus.net>
parents:
diff
changeset
|
62 topics: |
2d828f448081
topic: add tests for fold behavior with topics
Boris Feld <boris.feld@octobus.net>
parents:
diff
changeset
|
63 $ hg summary |
2d828f448081
topic: add tests for fold behavior with topics
Boris Feld <boris.feld@octobus.net>
parents:
diff
changeset
|
64 parent: 3:4fd43e5bdc44 tip |
2d828f448081
topic: add tests for fold behavior with topics
Boris Feld <boris.feld@octobus.net>
parents:
diff
changeset
|
65 folded |
2d828f448081
topic: add tests for fold behavior with topics
Boris Feld <boris.feld@octobus.net>
parents:
diff
changeset
|
66 branch: default |
2d828f448081
topic: add tests for fold behavior with topics
Boris Feld <boris.feld@octobus.net>
parents:
diff
changeset
|
67 commit: (clean) |
2d828f448081
topic: add tests for fold behavior with topics
Boris Feld <boris.feld@octobus.net>
parents:
diff
changeset
|
68 update: (current) |
2d828f448081
topic: add tests for fold behavior with topics
Boris Feld <boris.feld@octobus.net>
parents:
diff
changeset
|
69 phases: 2 draft |
2d828f448081
topic: add tests for fold behavior with topics
Boris Feld <boris.feld@octobus.net>
parents:
diff
changeset
|
70 topic: myfeature |
2d828f448081
topic: add tests for fold behavior with topics
Boris Feld <boris.feld@octobus.net>
parents:
diff
changeset
|
71 |
2d828f448081
topic: add tests for fold behavior with topics
Boris Feld <boris.feld@octobus.net>
parents:
diff
changeset
|
72 Check that fold dismis the topic if not all revisions have the topic |
2d828f448081
topic: add tests for fold behavior with topics
Boris Feld <boris.feld@octobus.net>
parents:
diff
changeset
|
73 -------------------------------------------------------------------- |
2d828f448081
topic: add tests for fold behavior with topics
Boris Feld <boris.feld@octobus.net>
parents:
diff
changeset
|
74 |
2d828f448081
topic: add tests for fold behavior with topics
Boris Feld <boris.feld@octobus.net>
parents:
diff
changeset
|
75 (I'm not sure this behavior make senses, but now it is tested) |
2d828f448081
topic: add tests for fold behavior with topics
Boris Feld <boris.feld@octobus.net>
parents:
diff
changeset
|
76 |
2d828f448081
topic: add tests for fold behavior with topics
Boris Feld <boris.feld@octobus.net>
parents:
diff
changeset
|
77 $ hg topic --clear |
2d828f448081
topic: add tests for fold behavior with topics
Boris Feld <boris.feld@octobus.net>
parents:
diff
changeset
|
78 $ mkcommit feature3 |
2d828f448081
topic: add tests for fold behavior with topics
Boris Feld <boris.feld@octobus.net>
parents:
diff
changeset
|
79 created new head |
2d828f448081
topic: add tests for fold behavior with topics
Boris Feld <boris.feld@octobus.net>
parents:
diff
changeset
|
80 $ hg topic myotherfeature |
2d828f448081
topic: add tests for fold behavior with topics
Boris Feld <boris.feld@octobus.net>
parents:
diff
changeset
|
81 $ mkcommit feature4 |
2d828f448081
topic: add tests for fold behavior with topics
Boris Feld <boris.feld@octobus.net>
parents:
diff
changeset
|
82 $ logtopic |
2d828f448081
topic: add tests for fold behavior with topics
Boris Feld <boris.feld@octobus.net>
parents:
diff
changeset
|
83 @ 5:5ded4d6d578c37f339b0716de2e46e12ece7cbde |
2d828f448081
topic: add tests for fold behavior with topics
Boris Feld <boris.feld@octobus.net>
parents:
diff
changeset
|
84 | topics: myotherfeature |
2d828f448081
topic: add tests for fold behavior with topics
Boris Feld <boris.feld@octobus.net>
parents:
diff
changeset
|
85 o 4:bdf6950b9b5b7c6b377c8132667c73ec86d5734f |
2d828f448081
topic: add tests for fold behavior with topics
Boris Feld <boris.feld@octobus.net>
parents:
diff
changeset
|
86 | topics: |
2d828f448081
topic: add tests for fold behavior with topics
Boris Feld <boris.feld@octobus.net>
parents:
diff
changeset
|
87 o 3:4fd43e5bdc443dc8489edffac19bd8f93ccf1a5c |
2d828f448081
topic: add tests for fold behavior with topics
Boris Feld <boris.feld@octobus.net>
parents:
diff
changeset
|
88 | topics: myfeature |
2d828f448081
topic: add tests for fold behavior with topics
Boris Feld <boris.feld@octobus.net>
parents:
diff
changeset
|
89 o 0:3e7df3b3b17c6deb4a1c70e790782fdf17af96a7 |
2d828f448081
topic: add tests for fold behavior with topics
Boris Feld <boris.feld@octobus.net>
parents:
diff
changeset
|
90 topics: |
2d828f448081
topic: add tests for fold behavior with topics
Boris Feld <boris.feld@octobus.net>
parents:
diff
changeset
|
91 $ hg fold --exact -r "(tip~1)::" -m "folded 2" |
2d828f448081
topic: add tests for fold behavior with topics
Boris Feld <boris.feld@octobus.net>
parents:
diff
changeset
|
92 2 changesets folded |
2d828f448081
topic: add tests for fold behavior with topics
Boris Feld <boris.feld@octobus.net>
parents:
diff
changeset
|
93 0 files updated, 0 files merged, 0 files removed, 0 files unresolved |
2d828f448081
topic: add tests for fold behavior with topics
Boris Feld <boris.feld@octobus.net>
parents:
diff
changeset
|
94 $ logtopic |
2d828f448081
topic: add tests for fold behavior with topics
Boris Feld <boris.feld@octobus.net>
parents:
diff
changeset
|
95 @ 6:03da8f7238e9a4d708d6b8af402c91c68f271477 |
2d828f448081
topic: add tests for fold behavior with topics
Boris Feld <boris.feld@octobus.net>
parents:
diff
changeset
|
96 | topics: |
2d828f448081
topic: add tests for fold behavior with topics
Boris Feld <boris.feld@octobus.net>
parents:
diff
changeset
|
97 o 3:4fd43e5bdc443dc8489edffac19bd8f93ccf1a5c |
2d828f448081
topic: add tests for fold behavior with topics
Boris Feld <boris.feld@octobus.net>
parents:
diff
changeset
|
98 | topics: myfeature |
2d828f448081
topic: add tests for fold behavior with topics
Boris Feld <boris.feld@octobus.net>
parents:
diff
changeset
|
99 o 0:3e7df3b3b17c6deb4a1c70e790782fdf17af96a7 |
2d828f448081
topic: add tests for fold behavior with topics
Boris Feld <boris.feld@octobus.net>
parents:
diff
changeset
|
100 topics: |
2d828f448081
topic: add tests for fold behavior with topics
Boris Feld <boris.feld@octobus.net>
parents:
diff
changeset
|
101 $ hg summary |
2d828f448081
topic: add tests for fold behavior with topics
Boris Feld <boris.feld@octobus.net>
parents:
diff
changeset
|
102 parent: 6:03da8f7238e9 tip |
2d828f448081
topic: add tests for fold behavior with topics
Boris Feld <boris.feld@octobus.net>
parents:
diff
changeset
|
103 folded 2 |
2d828f448081
topic: add tests for fold behavior with topics
Boris Feld <boris.feld@octobus.net>
parents:
diff
changeset
|
104 branch: default |
2d828f448081
topic: add tests for fold behavior with topics
Boris Feld <boris.feld@octobus.net>
parents:
diff
changeset
|
105 commit: (clean) |
2d828f448081
topic: add tests for fold behavior with topics
Boris Feld <boris.feld@octobus.net>
parents:
diff
changeset
|
106 update: (current) |
2d828f448081
topic: add tests for fold behavior with topics
Boris Feld <boris.feld@octobus.net>
parents:
diff
changeset
|
107 phases: 3 draft |