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