Show More
@@ -1,298 +1,314 b'' | |||||
1 | Tests for the journal extension; records bookmark locations. |
|
1 | Tests for the journal extension; records bookmark locations. | |
2 |
|
2 | |||
3 | $ cat >> testmocks.py << EOF |
|
3 | $ cat >> testmocks.py << EOF | |
4 | > # mock out procutil.getuser() and util.makedate() to supply testable values |
|
4 | > # mock out procutil.getuser() and util.makedate() to supply testable values | |
5 | > import os |
|
5 | > import os | |
6 | > from mercurial import pycompat, util |
|
6 | > from mercurial import pycompat, util | |
7 | > from mercurial.utils import dateutil, procutil |
|
7 | > from mercurial.utils import dateutil, procutil | |
8 | > def mockgetuser(): |
|
8 | > def mockgetuser(): | |
9 | > return b'foobar' |
|
9 | > return b'foobar' | |
10 | > |
|
10 | > | |
11 | > def mockmakedate(): |
|
11 | > def mockmakedate(): | |
12 | > filename = os.path.join(os.environ['TESTTMP'], 'testtime') |
|
12 | > filename = os.path.join(os.environ['TESTTMP'], 'testtime') | |
13 | > try: |
|
13 | > try: | |
14 | > with open(filename, 'rb') as timef: |
|
14 | > with open(filename, 'rb') as timef: | |
15 | > time = float(timef.read()) + 1 |
|
15 | > time = float(timef.read()) + 1 | |
16 | > except IOError: |
|
16 | > except IOError: | |
17 | > time = 0.0 |
|
17 | > time = 0.0 | |
18 | > with open(filename, 'wb') as timef: |
|
18 | > with open(filename, 'wb') as timef: | |
19 | > timef.write(pycompat.bytestr(time)) |
|
19 | > timef.write(pycompat.bytestr(time)) | |
20 | > return (time, 0) |
|
20 | > return (time, 0) | |
21 | > |
|
21 | > | |
22 | > procutil.getuser = mockgetuser |
|
22 | > procutil.getuser = mockgetuser | |
23 | > dateutil.makedate = mockmakedate |
|
23 | > dateutil.makedate = mockmakedate | |
24 | > EOF |
|
24 | > EOF | |
25 |
|
25 | |||
26 | $ cat >> $HGRCPATH << EOF |
|
26 | $ cat >> $HGRCPATH << EOF | |
27 | > [extensions] |
|
27 | > [extensions] | |
28 | > journal= |
|
28 | > journal= | |
29 | > testmocks=`pwd`/testmocks.py |
|
29 | > testmocks=`pwd`/testmocks.py | |
30 | > EOF |
|
30 | > EOF | |
31 |
|
31 | |||
32 | Setup repo |
|
32 | Setup repo | |
33 |
|
33 | |||
34 | $ hg init repo |
|
34 | $ hg init repo | |
35 | $ cd repo |
|
35 | $ cd repo | |
36 |
|
36 | |||
37 | Test empty journal |
|
37 | Test empty journal | |
38 |
|
38 | |||
39 | $ hg journal |
|
39 | $ hg journal | |
40 | previous locations of '.': |
|
40 | previous locations of '.': | |
41 | no recorded locations |
|
41 | no recorded locations | |
42 | $ hg journal foo |
|
42 | $ hg journal foo | |
43 | previous locations of 'foo': |
|
43 | previous locations of 'foo': | |
44 | no recorded locations |
|
44 | no recorded locations | |
45 |
|
45 | |||
46 | Test that working copy changes are tracked |
|
46 | Test that working copy changes are tracked | |
47 |
|
47 | |||
48 | $ echo a > a |
|
48 | $ echo a > a | |
49 | $ hg commit -Aqm a |
|
49 | $ hg commit -Aqm a | |
50 | $ hg journal |
|
50 | $ hg journal | |
51 | previous locations of '.': |
|
51 | previous locations of '.': | |
52 | cb9a9f314b8b commit -Aqm a |
|
52 | cb9a9f314b8b commit -Aqm a | |
53 | $ echo b > a |
|
53 | $ echo b > a | |
54 | $ hg commit -Aqm b |
|
54 | $ hg commit -Aqm b | |
55 | $ hg journal |
|
55 | $ hg journal | |
56 | previous locations of '.': |
|
56 | previous locations of '.': | |
57 | 1e6c11564562 commit -Aqm b |
|
57 | 1e6c11564562 commit -Aqm b | |
58 | cb9a9f314b8b commit -Aqm a |
|
58 | cb9a9f314b8b commit -Aqm a | |
59 | $ hg up 0 |
|
59 | $ hg up 0 | |
60 | 1 files updated, 0 files merged, 0 files removed, 0 files unresolved |
|
60 | 1 files updated, 0 files merged, 0 files removed, 0 files unresolved | |
61 | $ hg journal |
|
61 | $ hg journal | |
62 | previous locations of '.': |
|
62 | previous locations of '.': | |
63 | cb9a9f314b8b up 0 |
|
63 | cb9a9f314b8b up 0 | |
64 | 1e6c11564562 commit -Aqm b |
|
64 | 1e6c11564562 commit -Aqm b | |
65 | cb9a9f314b8b commit -Aqm a |
|
65 | cb9a9f314b8b commit -Aqm a | |
66 |
|
66 | |||
67 | Test that bookmarks are tracked |
|
67 | Test that bookmarks are tracked | |
68 |
|
68 | |||
69 | $ hg book -r tip bar |
|
69 | $ hg book -r tip bar | |
70 | $ hg journal bar |
|
70 | $ hg journal bar | |
71 | previous locations of 'bar': |
|
71 | previous locations of 'bar': | |
72 | 1e6c11564562 book -r tip bar |
|
72 | 1e6c11564562 book -r tip bar | |
73 | $ hg book -f bar |
|
73 | $ hg book -f bar | |
74 | $ hg journal bar |
|
74 | $ hg journal bar | |
75 | previous locations of 'bar': |
|
75 | previous locations of 'bar': | |
76 | cb9a9f314b8b book -f bar |
|
76 | cb9a9f314b8b book -f bar | |
77 | 1e6c11564562 book -r tip bar |
|
77 | 1e6c11564562 book -r tip bar | |
78 | $ hg up |
|
78 | $ hg up | |
79 | 1 files updated, 0 files merged, 0 files removed, 0 files unresolved |
|
79 | 1 files updated, 0 files merged, 0 files removed, 0 files unresolved | |
80 | updating bookmark bar |
|
80 | updating bookmark bar | |
81 | $ hg journal bar |
|
81 | $ hg journal bar | |
82 | previous locations of 'bar': |
|
82 | previous locations of 'bar': | |
83 | 1e6c11564562 up |
|
83 | 1e6c11564562 up | |
84 | cb9a9f314b8b book -f bar |
|
84 | cb9a9f314b8b book -f bar | |
85 | 1e6c11564562 book -r tip bar |
|
85 | 1e6c11564562 book -r tip bar | |
86 |
|
86 | |||
|
87 | Test that we tracks bookmark deletion | |||
|
88 | ||||
|
89 | $ hg book -r . babar | |||
|
90 | $ hg book -f -r .~1 babar | |||
|
91 | $ hg book -d babar | |||
|
92 | $ hg journal babar | |||
|
93 | previous locations of 'babar': | |||
|
94 | cb9a9f314b8b book -f -r '.~1' babar | |||
|
95 | 1e6c11564562 book -r . babar | |||
|
96 | ||||
87 | Test that bookmarks and working copy tracking is not mixed |
|
97 | Test that bookmarks and working copy tracking is not mixed | |
88 |
|
98 | |||
89 | $ hg journal |
|
99 | $ hg journal | |
90 | previous locations of '.': |
|
100 | previous locations of '.': | |
91 | 1e6c11564562 up |
|
101 | 1e6c11564562 up | |
92 | cb9a9f314b8b up 0 |
|
102 | cb9a9f314b8b up 0 | |
93 | 1e6c11564562 commit -Aqm b |
|
103 | 1e6c11564562 commit -Aqm b | |
94 | cb9a9f314b8b commit -Aqm a |
|
104 | cb9a9f314b8b commit -Aqm a | |
95 |
|
105 | |||
96 | Test that you can list all entries as well as limit the list or filter on them |
|
106 | Test that you can list all entries as well as limit the list or filter on them | |
97 |
|
107 | |||
98 | $ hg book -r tip baz |
|
108 | $ hg book -r tip baz | |
99 | $ hg journal --all |
|
109 | $ hg journal --all | |
100 | previous locations of the working copy and bookmarks: |
|
110 | previous locations of the working copy and bookmarks: | |
101 | 1e6c11564562 baz book -r tip baz |
|
111 | 1e6c11564562 baz book -r tip baz | |
|
112 | cb9a9f314b8b babar book -f -r '.~1' babar | |||
|
113 | 1e6c11564562 babar book -r . babar | |||
102 | 1e6c11564562 bar up |
|
114 | 1e6c11564562 bar up | |
103 | 1e6c11564562 . up |
|
115 | 1e6c11564562 . up | |
104 | cb9a9f314b8b bar book -f bar |
|
116 | cb9a9f314b8b bar book -f bar | |
105 | 1e6c11564562 bar book -r tip bar |
|
117 | 1e6c11564562 bar book -r tip bar | |
106 | cb9a9f314b8b . up 0 |
|
118 | cb9a9f314b8b . up 0 | |
107 | 1e6c11564562 . commit -Aqm b |
|
119 | 1e6c11564562 . commit -Aqm b | |
108 | cb9a9f314b8b . commit -Aqm a |
|
120 | cb9a9f314b8b . commit -Aqm a | |
109 | $ hg journal --limit 2 |
|
121 | $ hg journal --limit 2 | |
110 | previous locations of '.': |
|
122 | previous locations of '.': | |
111 | 1e6c11564562 up |
|
123 | 1e6c11564562 up | |
112 | cb9a9f314b8b up 0 |
|
124 | cb9a9f314b8b up 0 | |
113 | $ hg journal bar |
|
125 | $ hg journal bar | |
114 | previous locations of 'bar': |
|
126 | previous locations of 'bar': | |
115 | 1e6c11564562 up |
|
127 | 1e6c11564562 up | |
116 | cb9a9f314b8b book -f bar |
|
128 | cb9a9f314b8b book -f bar | |
117 | 1e6c11564562 book -r tip bar |
|
129 | 1e6c11564562 book -r tip bar | |
118 | $ hg journal foo |
|
130 | $ hg journal foo | |
119 | previous locations of 'foo': |
|
131 | previous locations of 'foo': | |
120 | no recorded locations |
|
132 | no recorded locations | |
121 | $ hg journal . |
|
133 | $ hg journal . | |
122 | previous locations of '.': |
|
134 | previous locations of '.': | |
123 | 1e6c11564562 up |
|
135 | 1e6c11564562 up | |
124 | cb9a9f314b8b up 0 |
|
136 | cb9a9f314b8b up 0 | |
125 | 1e6c11564562 commit -Aqm b |
|
137 | 1e6c11564562 commit -Aqm b | |
126 | cb9a9f314b8b commit -Aqm a |
|
138 | cb9a9f314b8b commit -Aqm a | |
127 | $ hg journal "re:ba." |
|
139 | $ hg journal "re:ba." | |
128 | previous locations of 're:ba.': |
|
140 | previous locations of 're:ba.': | |
129 | 1e6c11564562 baz book -r tip baz |
|
141 | 1e6c11564562 baz book -r tip baz | |
|
142 | cb9a9f314b8b babar book -f -r '.~1' babar | |||
|
143 | 1e6c11564562 babar book -r . babar | |||
130 | 1e6c11564562 bar up |
|
144 | 1e6c11564562 bar up | |
131 | cb9a9f314b8b bar book -f bar |
|
145 | cb9a9f314b8b bar book -f bar | |
132 | 1e6c11564562 bar book -r tip bar |
|
146 | 1e6c11564562 bar book -r tip bar | |
133 |
|
147 | |||
134 | Test that verbose, JSON, template and commit output work |
|
148 | Test that verbose, JSON, template and commit output work | |
135 |
|
149 | |||
136 | $ hg journal --verbose --all |
|
150 | $ hg journal --verbose --all | |
137 | previous locations of the working copy and bookmarks: |
|
151 | previous locations of the working copy and bookmarks: | |
138 | 000000000000 -> 1e6c11564562 foobar baz 1970-01-01 00:00 +0000 book -r tip baz |
|
152 | 000000000000 -> 1e6c11564562 foobar baz 1970-01-01 00:00 +0000 book -r tip baz | |
|
153 | 1e6c11564562 -> cb9a9f314b8b foobar babar 1970-01-01 00:00 +0000 book -f -r '.~1' babar | |||
|
154 | 000000000000 -> 1e6c11564562 foobar babar 1970-01-01 00:00 +0000 book -r . babar | |||
139 | cb9a9f314b8b -> 1e6c11564562 foobar bar 1970-01-01 00:00 +0000 up |
|
155 | cb9a9f314b8b -> 1e6c11564562 foobar bar 1970-01-01 00:00 +0000 up | |
140 | cb9a9f314b8b -> 1e6c11564562 foobar . 1970-01-01 00:00 +0000 up |
|
156 | cb9a9f314b8b -> 1e6c11564562 foobar . 1970-01-01 00:00 +0000 up | |
141 | 1e6c11564562 -> cb9a9f314b8b foobar bar 1970-01-01 00:00 +0000 book -f bar |
|
157 | 1e6c11564562 -> cb9a9f314b8b foobar bar 1970-01-01 00:00 +0000 book -f bar | |
142 | 000000000000 -> 1e6c11564562 foobar bar 1970-01-01 00:00 +0000 book -r tip bar |
|
158 | 000000000000 -> 1e6c11564562 foobar bar 1970-01-01 00:00 +0000 book -r tip bar | |
143 | 1e6c11564562 -> cb9a9f314b8b foobar . 1970-01-01 00:00 +0000 up 0 |
|
159 | 1e6c11564562 -> cb9a9f314b8b foobar . 1970-01-01 00:00 +0000 up 0 | |
144 | cb9a9f314b8b -> 1e6c11564562 foobar . 1970-01-01 00:00 +0000 commit -Aqm b |
|
160 | cb9a9f314b8b -> 1e6c11564562 foobar . 1970-01-01 00:00 +0000 commit -Aqm b | |
145 | 000000000000 -> cb9a9f314b8b foobar . 1970-01-01 00:00 +0000 commit -Aqm a |
|
161 | 000000000000 -> cb9a9f314b8b foobar . 1970-01-01 00:00 +0000 commit -Aqm a | |
146 | $ hg journal --verbose -Tjson |
|
162 | $ hg journal --verbose -Tjson | |
147 | [ |
|
163 | [ | |
148 | { |
|
164 | { | |
149 | "command": "up", |
|
165 | "command": "up", | |
150 | "date": [5, 0], |
|
166 | "date": [5, 0], | |
151 | "name": ".", |
|
167 | "name": ".", | |
152 | "newnodes": ["1e6c11564562b4ed919baca798bc4338bd299d6a"], |
|
168 | "newnodes": ["1e6c11564562b4ed919baca798bc4338bd299d6a"], | |
153 | "oldnodes": ["cb9a9f314b8b07ba71012fcdbc544b5a4d82ff5b"], |
|
169 | "oldnodes": ["cb9a9f314b8b07ba71012fcdbc544b5a4d82ff5b"], | |
154 | "user": "foobar" |
|
170 | "user": "foobar" | |
155 | }, |
|
171 | }, | |
156 | { |
|
172 | { | |
157 | "command": "up 0", |
|
173 | "command": "up 0", | |
158 | "date": [2, 0], |
|
174 | "date": [2, 0], | |
159 | "name": ".", |
|
175 | "name": ".", | |
160 | "newnodes": ["cb9a9f314b8b07ba71012fcdbc544b5a4d82ff5b"], |
|
176 | "newnodes": ["cb9a9f314b8b07ba71012fcdbc544b5a4d82ff5b"], | |
161 | "oldnodes": ["1e6c11564562b4ed919baca798bc4338bd299d6a"], |
|
177 | "oldnodes": ["1e6c11564562b4ed919baca798bc4338bd299d6a"], | |
162 | "user": "foobar" |
|
178 | "user": "foobar" | |
163 | }, |
|
179 | }, | |
164 | { |
|
180 | { | |
165 | "command": "commit -Aqm b", |
|
181 | "command": "commit -Aqm b", | |
166 | "date": [1, 0], |
|
182 | "date": [1, 0], | |
167 | "name": ".", |
|
183 | "name": ".", | |
168 | "newnodes": ["1e6c11564562b4ed919baca798bc4338bd299d6a"], |
|
184 | "newnodes": ["1e6c11564562b4ed919baca798bc4338bd299d6a"], | |
169 | "oldnodes": ["cb9a9f314b8b07ba71012fcdbc544b5a4d82ff5b"], |
|
185 | "oldnodes": ["cb9a9f314b8b07ba71012fcdbc544b5a4d82ff5b"], | |
170 | "user": "foobar" |
|
186 | "user": "foobar" | |
171 | }, |
|
187 | }, | |
172 | { |
|
188 | { | |
173 | "command": "commit -Aqm a", |
|
189 | "command": "commit -Aqm a", | |
174 | "date": [0, 0], |
|
190 | "date": [0, 0], | |
175 | "name": ".", |
|
191 | "name": ".", | |
176 | "newnodes": ["cb9a9f314b8b07ba71012fcdbc544b5a4d82ff5b"], |
|
192 | "newnodes": ["cb9a9f314b8b07ba71012fcdbc544b5a4d82ff5b"], | |
177 | "oldnodes": ["0000000000000000000000000000000000000000"], |
|
193 | "oldnodes": ["0000000000000000000000000000000000000000"], | |
178 | "user": "foobar" |
|
194 | "user": "foobar" | |
179 | } |
|
195 | } | |
180 | ] |
|
196 | ] | |
181 |
|
197 | |||
182 | $ cat <<EOF >> $HGRCPATH |
|
198 | $ cat <<EOF >> $HGRCPATH | |
183 | > [templates] |
|
199 | > [templates] | |
184 | > j = "{oldnodes % '{node|upper}'} -> {newnodes % '{node|upper}'} |
|
200 | > j = "{oldnodes % '{node|upper}'} -> {newnodes % '{node|upper}'} | |
185 | > - user: {user} |
|
201 | > - user: {user} | |
186 | > - command: {command} |
|
202 | > - command: {command} | |
187 | > - date: {date|rfc3339date} |
|
203 | > - date: {date|rfc3339date} | |
188 | > - newnodes: {newnodes} |
|
204 | > - newnodes: {newnodes} | |
189 | > - oldnodes: {oldnodes} |
|
205 | > - oldnodes: {oldnodes} | |
190 | > " |
|
206 | > " | |
191 | > EOF |
|
207 | > EOF | |
192 | $ hg journal -Tj -l1 |
|
208 | $ hg journal -Tj -l1 | |
193 | previous locations of '.': |
|
209 | previous locations of '.': | |
194 | CB9A9F314B8B07BA71012FCDBC544B5A4D82FF5B -> 1E6C11564562B4ED919BACA798BC4338BD299D6A |
|
210 | CB9A9F314B8B07BA71012FCDBC544B5A4D82FF5B -> 1E6C11564562B4ED919BACA798BC4338BD299D6A | |
195 | - user: foobar |
|
211 | - user: foobar | |
196 | - command: up |
|
212 | - command: up | |
197 | - date: 1970-01-01T00:00:05+00:00 |
|
213 | - date: 1970-01-01T00:00:05+00:00 | |
198 | - newnodes: 1e6c11564562b4ed919baca798bc4338bd299d6a |
|
214 | - newnodes: 1e6c11564562b4ed919baca798bc4338bd299d6a | |
199 | - oldnodes: cb9a9f314b8b07ba71012fcdbc544b5a4d82ff5b |
|
215 | - oldnodes: cb9a9f314b8b07ba71012fcdbc544b5a4d82ff5b | |
200 |
|
216 | |||
201 | $ hg journal --commit |
|
217 | $ hg journal --commit | |
202 | previous locations of '.': |
|
218 | previous locations of '.': | |
203 | 1e6c11564562 up |
|
219 | 1e6c11564562 up | |
204 | changeset: 1:1e6c11564562 |
|
220 | changeset: 1:1e6c11564562 | |
205 | bookmark: bar |
|
221 | bookmark: bar | |
206 | bookmark: baz |
|
222 | bookmark: baz | |
207 | tag: tip |
|
223 | tag: tip | |
208 | user: test |
|
224 | user: test | |
209 | date: Thu Jan 01 00:00:00 1970 +0000 |
|
225 | date: Thu Jan 01 00:00:00 1970 +0000 | |
210 | summary: b |
|
226 | summary: b | |
211 |
|
227 | |||
212 | cb9a9f314b8b up 0 |
|
228 | cb9a9f314b8b up 0 | |
213 | changeset: 0:cb9a9f314b8b |
|
229 | changeset: 0:cb9a9f314b8b | |
214 | user: test |
|
230 | user: test | |
215 | date: Thu Jan 01 00:00:00 1970 +0000 |
|
231 | date: Thu Jan 01 00:00:00 1970 +0000 | |
216 | summary: a |
|
232 | summary: a | |
217 |
|
233 | |||
218 | 1e6c11564562 commit -Aqm b |
|
234 | 1e6c11564562 commit -Aqm b | |
219 | changeset: 1:1e6c11564562 |
|
235 | changeset: 1:1e6c11564562 | |
220 | bookmark: bar |
|
236 | bookmark: bar | |
221 | bookmark: baz |
|
237 | bookmark: baz | |
222 | tag: tip |
|
238 | tag: tip | |
223 | user: test |
|
239 | user: test | |
224 | date: Thu Jan 01 00:00:00 1970 +0000 |
|
240 | date: Thu Jan 01 00:00:00 1970 +0000 | |
225 | summary: b |
|
241 | summary: b | |
226 |
|
242 | |||
227 | cb9a9f314b8b commit -Aqm a |
|
243 | cb9a9f314b8b commit -Aqm a | |
228 | changeset: 0:cb9a9f314b8b |
|
244 | changeset: 0:cb9a9f314b8b | |
229 | user: test |
|
245 | user: test | |
230 | date: Thu Jan 01 00:00:00 1970 +0000 |
|
246 | date: Thu Jan 01 00:00:00 1970 +0000 | |
231 | summary: a |
|
247 | summary: a | |
232 |
|
248 | |||
233 |
|
249 | |||
234 | $ hg journal --commit -Tjson |
|
250 | $ hg journal --commit -Tjson | |
235 | [ |
|
251 | [ | |
236 | { |
|
252 | { | |
237 | "changesets": [{"bookmarks": ["bar", "baz"], "branch": "default", "date": [0, 0], "desc": "b", "node": "1e6c11564562b4ed919baca798bc4338bd299d6a", "parents": ["cb9a9f314b8b07ba71012fcdbc544b5a4d82ff5b"], "phase": "draft", "rev": 1, "tags": ["tip"], "user": "test"}], |
|
253 | "changesets": [{"bookmarks": ["bar", "baz"], "branch": "default", "date": [0, 0], "desc": "b", "node": "1e6c11564562b4ed919baca798bc4338bd299d6a", "parents": ["cb9a9f314b8b07ba71012fcdbc544b5a4d82ff5b"], "phase": "draft", "rev": 1, "tags": ["tip"], "user": "test"}], | |
238 | "command": "up", |
|
254 | "command": "up", | |
239 | "date": [5, 0], |
|
255 | "date": [5, 0], | |
240 | "name": ".", |
|
256 | "name": ".", | |
241 | "newnodes": ["1e6c11564562b4ed919baca798bc4338bd299d6a"], |
|
257 | "newnodes": ["1e6c11564562b4ed919baca798bc4338bd299d6a"], | |
242 | "oldnodes": ["cb9a9f314b8b07ba71012fcdbc544b5a4d82ff5b"], |
|
258 | "oldnodes": ["cb9a9f314b8b07ba71012fcdbc544b5a4d82ff5b"], | |
243 | "user": "foobar" |
|
259 | "user": "foobar" | |
244 | }, |
|
260 | }, | |
245 | { |
|
261 | { | |
246 | "changesets": [{"bookmarks": [], "branch": "default", "date": [0, 0], "desc": "a", "node": "cb9a9f314b8b07ba71012fcdbc544b5a4d82ff5b", "parents": ["0000000000000000000000000000000000000000"], "phase": "draft", "rev": 0, "tags": [], "user": "test"}], |
|
262 | "changesets": [{"bookmarks": [], "branch": "default", "date": [0, 0], "desc": "a", "node": "cb9a9f314b8b07ba71012fcdbc544b5a4d82ff5b", "parents": ["0000000000000000000000000000000000000000"], "phase": "draft", "rev": 0, "tags": [], "user": "test"}], | |
247 | "command": "up 0", |
|
263 | "command": "up 0", | |
248 | "date": [2, 0], |
|
264 | "date": [2, 0], | |
249 | "name": ".", |
|
265 | "name": ".", | |
250 | "newnodes": ["cb9a9f314b8b07ba71012fcdbc544b5a4d82ff5b"], |
|
266 | "newnodes": ["cb9a9f314b8b07ba71012fcdbc544b5a4d82ff5b"], | |
251 | "oldnodes": ["1e6c11564562b4ed919baca798bc4338bd299d6a"], |
|
267 | "oldnodes": ["1e6c11564562b4ed919baca798bc4338bd299d6a"], | |
252 | "user": "foobar" |
|
268 | "user": "foobar" | |
253 | }, |
|
269 | }, | |
254 | { |
|
270 | { | |
255 | "changesets": [{"bookmarks": ["bar", "baz"], "branch": "default", "date": [0, 0], "desc": "b", "node": "1e6c11564562b4ed919baca798bc4338bd299d6a", "parents": ["cb9a9f314b8b07ba71012fcdbc544b5a4d82ff5b"], "phase": "draft", "rev": 1, "tags": ["tip"], "user": "test"}], |
|
271 | "changesets": [{"bookmarks": ["bar", "baz"], "branch": "default", "date": [0, 0], "desc": "b", "node": "1e6c11564562b4ed919baca798bc4338bd299d6a", "parents": ["cb9a9f314b8b07ba71012fcdbc544b5a4d82ff5b"], "phase": "draft", "rev": 1, "tags": ["tip"], "user": "test"}], | |
256 | "command": "commit -Aqm b", |
|
272 | "command": "commit -Aqm b", | |
257 | "date": [1, 0], |
|
273 | "date": [1, 0], | |
258 | "name": ".", |
|
274 | "name": ".", | |
259 | "newnodes": ["1e6c11564562b4ed919baca798bc4338bd299d6a"], |
|
275 | "newnodes": ["1e6c11564562b4ed919baca798bc4338bd299d6a"], | |
260 | "oldnodes": ["cb9a9f314b8b07ba71012fcdbc544b5a4d82ff5b"], |
|
276 | "oldnodes": ["cb9a9f314b8b07ba71012fcdbc544b5a4d82ff5b"], | |
261 | "user": "foobar" |
|
277 | "user": "foobar" | |
262 | }, |
|
278 | }, | |
263 | { |
|
279 | { | |
264 | "changesets": [{"bookmarks": [], "branch": "default", "date": [0, 0], "desc": "a", "node": "cb9a9f314b8b07ba71012fcdbc544b5a4d82ff5b", "parents": ["0000000000000000000000000000000000000000"], "phase": "draft", "rev": 0, "tags": [], "user": "test"}], |
|
280 | "changesets": [{"bookmarks": [], "branch": "default", "date": [0, 0], "desc": "a", "node": "cb9a9f314b8b07ba71012fcdbc544b5a4d82ff5b", "parents": ["0000000000000000000000000000000000000000"], "phase": "draft", "rev": 0, "tags": [], "user": "test"}], | |
265 | "command": "commit -Aqm a", |
|
281 | "command": "commit -Aqm a", | |
266 | "date": [0, 0], |
|
282 | "date": [0, 0], | |
267 | "name": ".", |
|
283 | "name": ".", | |
268 | "newnodes": ["cb9a9f314b8b07ba71012fcdbc544b5a4d82ff5b"], |
|
284 | "newnodes": ["cb9a9f314b8b07ba71012fcdbc544b5a4d82ff5b"], | |
269 | "oldnodes": ["0000000000000000000000000000000000000000"], |
|
285 | "oldnodes": ["0000000000000000000000000000000000000000"], | |
270 | "user": "foobar" |
|
286 | "user": "foobar" | |
271 | } |
|
287 | } | |
272 | ] |
|
288 | ] | |
273 |
|
289 | |||
274 | $ hg journal --commit \ |
|
290 | $ hg journal --commit \ | |
275 | > -T'command: {command}\n{changesets % " rev: {rev}\n children: {children}\n"}' |
|
291 | > -T'command: {command}\n{changesets % " rev: {rev}\n children: {children}\n"}' | |
276 | previous locations of '.': |
|
292 | previous locations of '.': | |
277 | command: up |
|
293 | command: up | |
278 | rev: 1 |
|
294 | rev: 1 | |
279 | children: |
|
295 | children: | |
280 | command: up 0 |
|
296 | command: up 0 | |
281 | rev: 0 |
|
297 | rev: 0 | |
282 | children: 1:1e6c11564562 |
|
298 | children: 1:1e6c11564562 | |
283 | command: commit -Aqm b |
|
299 | command: commit -Aqm b | |
284 | rev: 1 |
|
300 | rev: 1 | |
285 | children: |
|
301 | children: | |
286 | command: commit -Aqm a |
|
302 | command: commit -Aqm a | |
287 | rev: 0 |
|
303 | rev: 0 | |
288 | children: 1:1e6c11564562 |
|
304 | children: 1:1e6c11564562 | |
289 |
|
305 | |||
290 | Test for behaviour on unexpected storage version information |
|
306 | Test for behaviour on unexpected storage version information | |
291 |
|
307 | |||
292 | $ printf '42\0' > .hg/namejournal |
|
308 | $ printf '42\0' > .hg/namejournal | |
293 | $ hg journal |
|
309 | $ hg journal | |
294 | previous locations of '.': |
|
310 | previous locations of '.': | |
295 | abort: unknown journal file version '42' |
|
311 | abort: unknown journal file version '42' | |
296 | [255] |
|
312 | [255] | |
297 | $ hg book -r tip doomed |
|
313 | $ hg book -r tip doomed | |
298 | unsupported journal file version '42' |
|
314 | unsupported journal file version '42' |
General Comments 0
You need to be logged in to leave comments.
Login now