comparison tests/test-obsmarkers-effectflag.t @ 34414:468646386e95

tests: add tests for effect flags Add all the tests in this patch, it makes the patch quite big but will clarify the following patches impact on tests. Differential Revision: https://phab.mercurial-scm.org/D534
author Boris Feld <boris.feld@octobus.net>
date Thu, 06 Jul 2017 14:51:08 +0200
parents
children 51aadc0d0da2
comparison
equal deleted inserted replaced
34413:014d467f9d08 34414:468646386e95
1 Test the 'effect-flags' feature
2
3 Global setup
4 ============
5
6 $ . $TESTDIR/testlib/obsmarker-common.sh
7 $ cat >> $HGRCPATH <<EOF
8 > [ui]
9 > interactive = true
10 > [phases]
11 > publish=False
12 > [extensions]
13 > rebase =
14 > [experimental]
15 > evolution = all
16 > effect-flags = 1
17 > EOF
18
19 $ hg init $TESTTMP/effect-flags
20 $ cd $TESTTMP/effect-flags
21 $ mkcommit ROOT
22
23 amend touching the description only
24 -----------------------------------
25
26 $ mkcommit A0
27 $ hg commit --amend -m "A1"
28
29 check result
30
31 $ hg debugobsolete --rev .
32 471f378eab4c5e25f6c77f785b27c936efb22874 fdf9bde5129a28d4548fadd3f62b265cdd3b7a2e 0 (Thu Jan 01 00:00:00 1970 +0000) {'ef1': '0', 'operation': 'amend', 'user': 'test'}
33
34 amend touching the user only
35 ----------------------------
36
37 $ mkcommit B0
38 $ hg commit --amend -u "bob <bob@bob.com>"
39
40 check result
41
42 $ hg debugobsolete --rev .
43 ef4a313b1e0ade55718395d80e6b88c5ccd875eb 5485c92d34330dac9d7a63dc07e1e3373835b964 0 (Thu Jan 01 00:00:00 1970 +0000) {'ef1': '0', 'operation': 'amend', 'user': 'test'}
44
45 amend touching the date only
46 ----------------------------
47
48 $ mkcommit B1
49 $ hg commit --amend -d "42 0"
50
51 check result
52
53 $ hg debugobsolete --rev .
54 2ef0680ff45038ac28c9f1ff3644341f54487280 4dd84345082e9e5291c2e6b3f335bbf8bf389378 0 (Thu Jan 01 00:00:00 1970 +0000) {'ef1': '0', 'operation': 'amend', 'user': 'test'}
55
56 amend touching the branch only
57 ----------------------------
58
59 $ mkcommit B2
60 $ hg branch my-branch
61 marked working directory as branch my-branch
62 (branches are permanent and global, did you want a bookmark?)
63 $ hg commit --amend
64
65 check result
66
67 $ hg debugobsolete --rev .
68 bd3db8264ceebf1966319f5df3be7aac6acd1a8e 14a01456e0574f0e0a0b15b2345486a6364a8d79 0 (Thu Jan 01 00:00:00 1970 +0000) {'ef1': '0', 'operation': 'amend', 'user': 'test'}
69
70 $ hg up default
71 0 files updated, 0 files merged, 1 files removed, 0 files unresolved
72
73 rebase (parents change)
74 -----------------------
75
76 $ mkcommit C0
77 $ mkcommit D0
78 $ hg rebase -r . -d 'desc(B0)'
79 rebasing 10:c85eff83a034 "D0" (tip)
80
81 check result
82
83 $ hg debugobsolete --rev .
84 c85eff83a0340efd9da52b806a94c350222f3371 da86aa2f19a30d6686b15cae15c7b6c908ec9699 0 (Thu Jan 01 00:00:00 1970 +0000) {'ef1': '0', 'operation': 'rebase', 'user': 'test'}
85
86 amend touching the diff
87 -----------------------
88
89 $ mkcommit E0
90 $ echo 42 >> E0
91 $ hg commit --amend
92
93 check result
94
95 $ hg debugobsolete --rev .
96 ebfe0333e0d96f68a917afd97c0a0af87f1c3b5f 75781fdbdbf58a987516b00c980bccda1e9ae588 0 (Thu Jan 01 00:00:00 1970 +0000) {'ef1': '0', 'operation': 'amend', 'user': 'test'}
97
98 amend with multiple effect (desc and meta)
99 -------------------------------------------
100
101 $ mkcommit F0
102 $ hg branch my-other-branch
103 marked working directory as branch my-other-branch
104 $ hg commit --amend -m F1 -u "bob <bob@bob.com>" -d "42 0"
105
106 check result
107
108 $ hg debugobsolete --rev .
109 fad47e5bd78e6aa4db1b5a0a1751bc12563655ff a94e0fd5f1c81d969381a76eb0d37ce499a44fae 0 (Thu Jan 01 00:00:00 1970 +0000) {'ef1': '0', 'operation': 'amend', 'user': 'test'}
110
111 rebase not touching the diff
112 ----------------------------
113
114 $ cat << EOF > H0
115 > 0
116 > 1
117 > 2
118 > 3
119 > 4
120 > 5
121 > 6
122 > 7
123 > 8
124 > 9
125 > 10
126 > EOF
127 $ hg add H0
128 $ hg commit -m 'H0'
129 $ echo "H1" >> H0
130 $ hg commit -m "H1"
131 $ hg up -r "desc(H0)"
132 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
133 $ cat << EOF > H0
134 > H2
135 > 0
136 > 1
137 > 2
138 > 3
139 > 4
140 > 5
141 > 6
142 > 7
143 > 8
144 > 9
145 > 10
146 > EOF
147 $ hg commit -m "H2"
148 created new head
149 $ hg rebase -s "desc(H1)" -d "desc(H2)" -t :merge3
150 rebasing 17:b57fed8d8322 "H1"
151 merging H0
152 $ hg debugobsolete -r tip
153 b57fed8d83228a8ae3748d8c3760a77638dd4f8c e509e2eb3df5d131ff7c02350bf2a9edd0c09478 0 (Thu Jan 01 00:00:00 1970 +0000) {'ef1': '0', 'operation': 'rebase', 'user': 'test'}
154
155 amend closing the branch should be detected as meta change
156 ----------------------------------------------------------
157
158 $ hg branch closedbranch
159 marked working directory as branch closedbranch
160 $ mkcommit G0
161 $ mkcommit I0
162 $ hg commit --amend --close-branch
163
164 check result
165
166 $ hg debugobsolete -r .
167 2f599e54c1c6974299065cdf54e1ad640bfb7b5d 12c6238b5e371eea00fd2013b12edce3f070928b 0 (Thu Jan 01 00:00:00 1970 +0000) {'ef1': '0', 'operation': 'amend', 'user': 'test'}