comparison tests/test-evolve-obshistory.t @ 3886:8f27e17c3558

tests: extract the obshistory amend test case into a separate file
author Boris Feld <boris.feld@octobus.net>
date Tue, 22 May 2018 15:40:29 +0200
parents 3df8b6ecce2a
children 3eb9d9715776
comparison
equal deleted inserted replaced
3885:3df8b6ecce2a 3886:8f27e17c3558
20 @ 000000000000 (-1) 20 @ 000000000000 (-1)
21 21
22 $ hg obslog 'wdir()' 22 $ hg obslog 'wdir()'
23 abort: working directory revision cannot be specified 23 abort: working directory revision cannot be specified
24 [255] 24 [255]
25
26 Test output on amended commit
27 =============================
28
29 Test setup
30 ----------
31
32 $ hg init $TESTTMP/local-amend
33 $ cd $TESTTMP/local-amend
34 $ mkcommit ROOT
35 $ mkcommit A0
36 $ echo 42 >> A0
37 $ hg amend -m "A1
38 >
39 > Better commit message"
40 $ hg log --hidden -G
41 @ changeset: 2:4ae3a4151de9
42 | tag: tip
43 | parent: 0:ea207398892e
44 | user: test
45 | date: Thu Jan 01 00:00:00 1970 +0000
46 | summary: A1
47 |
48 | x changeset: 1:471f378eab4c
49 |/ user: test
50 | date: Thu Jan 01 00:00:00 1970 +0000
51 | obsolete: rewritten using amend as 2:4ae3a4151de9
52 | summary: A0
53 |
54 o changeset: 0:ea207398892e
55 user: test
56 date: Thu Jan 01 00:00:00 1970 +0000
57 summary: ROOT
58
59 Actual test
60 -----------
61 $ hg obslog --patch 4ae3a4151de9
62 @ 4ae3a4151de9 (2) A1
63 |
64 x 471f378eab4c (1) A0
65 rewritten(description, content) as 4ae3a4151de9 using amend by test (*) (glob)
66 diff -r 471f378eab4c -r 4ae3a4151de9 changeset-description
67 --- a/changeset-description
68 +++ b/changeset-description
69 @@ -1,1 +1,3 @@
70 -A0
71 +A1
72 +
73 +Better commit message
74
75 diff -r 471f378eab4c -r 4ae3a4151de9 A0
76 --- a/A0 Thu Jan 01 00:00:00 1970 +0000
77 +++ b/A0 Thu Jan 01 00:00:00 1970 +0000
78 @@ -1,1 +1,2 @@
79 A0
80 +42
81
82
83 $ hg obslog --patch --color debug
84 @ [evolve.node|4ae3a4151de9] [evolve.rev|(2)] [evolve.short_description|A1]
85 |
86 x [evolve.node|471f378eab4c] [evolve.rev|(1)] [evolve.short_description|A0]
87 [evolve.verb|rewritten](description, content) as [evolve.node|4ae3a4151de9] using [evolve.operation|amend] by [evolve.user|test] [evolve.date|(Thu Jan 01 00:00:00 1970 +0000)]
88 [diff.diffline|diff -r 471f378eab4c -r 4ae3a4151de9 changeset-description]
89 [diff.file_a|--- a/changeset-description]
90 [diff.file_b|+++ b/changeset-description]
91 [diff.hunk|@@ -1,1 +1,3 @@]
92 [diff.deleted|-A0]
93 [diff.inserted|+A1]
94 [diff.inserted|+]
95 [diff.inserted|+Better commit message]
96
97 [diff.diffline|diff -r 471f378eab4c -r 4ae3a4151de9 A0]
98 [diff.file_a|--- a/A0 Thu Jan 01 00:00:00 1970 +0000]
99 [diff.file_b|+++ b/A0 Thu Jan 01 00:00:00 1970 +0000]
100 [diff.hunk|@@ -1,1 +1,2 @@]
101 A0
102 [diff.inserted|+42]
103
104
105
106 $ hg obslog --no-graph --patch 4ae3a4151de9
107 4ae3a4151de9 (2) A1
108 471f378eab4c (1) A0
109 rewritten(description, content) as 4ae3a4151de9 using amend by test (Thu Jan 01 00:00:00 1970 +0000)
110 diff -r 471f378eab4c -r 4ae3a4151de9 changeset-description
111 --- a/changeset-description
112 +++ b/changeset-description
113 @@ -1,1 +1,3 @@
114 -A0
115 +A1
116 +
117 +Better commit message
118
119 diff -r 471f378eab4c -r 4ae3a4151de9 A0
120 --- a/A0 Thu Jan 01 00:00:00 1970 +0000
121 +++ b/A0 Thu Jan 01 00:00:00 1970 +0000
122 @@ -1,1 +1,2 @@
123 A0
124 +42
125
126
127 $ hg obslog 4ae3a4151de9 --graph -T'{label("log.summary", shortdescription)} {if(markers, join(markers % "at {date|hgdate} by {user|person} ", " also "))}'
128 @ A1
129 |
130 x A0 at 0 0 by test
131
132 $ hg obslog 4ae3a4151de9 --no-graph -Tjson | python -m json.tool
133 [
134 {
135 "markers": [],
136 "node": "4ae3a4151de9",
137 "rev": 2,
138 "shortdescription": "A1"
139 },
140 {
141 "markers": [
142 {
143 "date": [
144 *, (glob)
145 0 (glob)
146 ],
147 "effect": [
148 "description",
149 "content"
150 ],
151 "operation": "amend",
152 "succnodes": [
153 "4ae3a4151de9"
154 ],
155 "user": "test",
156 "verb": "rewritten"
157 }
158 ],
159 "node": "471f378eab4c",
160 "rev": 1,
161 "shortdescription": "A0"
162 }
163 ]
164 $ hg obslog --hidden --patch 471f378eab4c
165 x 471f378eab4c (1) A0
166 rewritten(description, content) as 4ae3a4151de9 using amend by test (Thu Jan 01 00:00:00 1970 +0000)
167 diff -r 471f378eab4c -r 4ae3a4151de9 changeset-description
168 --- a/changeset-description
169 +++ b/changeset-description
170 @@ -1,1 +1,3 @@
171 -A0
172 +A1
173 +
174 +Better commit message
175
176 diff -r 471f378eab4c -r 4ae3a4151de9 A0
177 --- a/A0 Thu Jan 01 00:00:00 1970 +0000
178 +++ b/A0 Thu Jan 01 00:00:00 1970 +0000
179 @@ -1,1 +1,2 @@
180 A0
181 +42
182
183
184 $ hg obslog --hidden 471f378eab4c --no-graph -Tjson | python -m json.tool
185 [
186 {
187 "markers": [
188 {
189 "date": [
190 *, (glob)
191 0 (glob)
192 ],
193 "effect": [
194 *, (glob)
195 "content"
196 ],
197 "operation": "amend",
198 "succnodes": [
199 "4ae3a4151de9"
200 ],
201 "user": "test",
202 "verb": "rewritten"
203 }
204 ],
205 "node": "471f378eab4c",
206 "rev": 1,
207 "shortdescription": "A0"
208 }
209 ]
210 $ hg update 471f378eab4c
211 abort: hidden revision '471f378eab4c' was rewritten as: 4ae3a4151de9!
212 (use --hidden to access hidden revisions)
213 [255]
214 $ hg update --hidden "desc(A0)"
215 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
216 updated to hidden changeset 471f378eab4c
217 (hidden revision '471f378eab4c' was rewritten as: 4ae3a4151de9)
218 working directory parent is obsolete! (471f378eab4c)
219 (use 'hg evolve' to update to its successor: 4ae3a4151de9)
220 25
221 Test output with pruned commit 26 Test output with pruned commit
222 ============================== 27 ==============================
223 28
224 Test setup 29 Test setup