Show More
@@ -475,8 +475,10 b' def journal(ui, repo, *args, **opts):' | |||||
475 | for count, entry in enumerate(repo.journal.filtered(name=name)): |
|
475 | for count, entry in enumerate(repo.journal.filtered(name=name)): | |
476 | if count == limit: |
|
476 | if count == limit: | |
477 | break |
|
477 | break | |
478 |
newhashesstr = |
|
478 | newhashesstr = fm.formatlist(map(fm.hexfunc, entry.newhashes), | |
479 | oldhashesstr = ','.join([fm.hexfunc(hash) for hash in entry.oldhashes]) |
|
479 | name='node', sep=',') | |
|
480 | oldhashesstr = fm.formatlist(map(fm.hexfunc, entry.oldhashes), | |||
|
481 | name='node', sep=',') | |||
480 |
|
482 | |||
481 | fm.startitem() |
|
483 | fm.startitem() | |
482 | fm.condwrite(ui.verbose, 'oldhashes', '%s -> ', oldhashesstr) |
|
484 | fm.condwrite(ui.verbose, 'oldhashes', '%s -> ', oldhashesstr) |
@@ -130,7 +130,7 b' Test that you can list all entries as we' | |||||
130 | cb9a9f314b8b bar book -f bar |
|
130 | cb9a9f314b8b bar book -f bar | |
131 | 1e6c11564562 bar book -r tip bar |
|
131 | 1e6c11564562 bar book -r tip bar | |
132 |
|
132 | |||
133 | Test that verbose, JSON and commit output work |
|
133 | Test that verbose, JSON, template and commit output work | |
134 |
|
134 | |||
135 | $ hg journal --verbose --all |
|
135 | $ hg journal --verbose --all | |
136 | previous locations of the working copy and bookmarks: |
|
136 | previous locations of the working copy and bookmarks: | |
@@ -148,35 +148,53 b' Test that verbose, JSON and commit outpu' | |||||
148 | "command": "up", |
|
148 | "command": "up", | |
149 | "date": "1970-01-01 00:00 +0000", |
|
149 | "date": "1970-01-01 00:00 +0000", | |
150 | "name": ".", |
|
150 | "name": ".", | |
151 | "newhashes": "1e6c11564562b4ed919baca798bc4338bd299d6a", |
|
151 | "newhashes": ["1e6c11564562b4ed919baca798bc4338bd299d6a"], | |
152 | "oldhashes": "cb9a9f314b8b07ba71012fcdbc544b5a4d82ff5b", |
|
152 | "oldhashes": ["cb9a9f314b8b07ba71012fcdbc544b5a4d82ff5b"], | |
153 | "user": "foobar" |
|
153 | "user": "foobar" | |
154 |
} |
|
154 | }, | |
155 | { |
|
155 | { | |
156 | "command": "up 0", |
|
156 | "command": "up 0", | |
157 | "date": "1970-01-01 00:00 +0000", |
|
157 | "date": "1970-01-01 00:00 +0000", | |
158 | "name": ".", |
|
158 | "name": ".", | |
159 | "newhashes": "cb9a9f314b8b07ba71012fcdbc544b5a4d82ff5b", |
|
159 | "newhashes": ["cb9a9f314b8b07ba71012fcdbc544b5a4d82ff5b"], | |
160 | "oldhashes": "1e6c11564562b4ed919baca798bc4338bd299d6a", |
|
160 | "oldhashes": ["1e6c11564562b4ed919baca798bc4338bd299d6a"], | |
161 | "user": "foobar" |
|
161 | "user": "foobar" | |
162 |
} |
|
162 | }, | |
163 | { |
|
163 | { | |
164 | "command": "commit -Aqm b", |
|
164 | "command": "commit -Aqm b", | |
165 | "date": "1970-01-01 00:00 +0000", |
|
165 | "date": "1970-01-01 00:00 +0000", | |
166 | "name": ".", |
|
166 | "name": ".", | |
167 | "newhashes": "1e6c11564562b4ed919baca798bc4338bd299d6a", |
|
167 | "newhashes": ["1e6c11564562b4ed919baca798bc4338bd299d6a"], | |
168 | "oldhashes": "cb9a9f314b8b07ba71012fcdbc544b5a4d82ff5b", |
|
168 | "oldhashes": ["cb9a9f314b8b07ba71012fcdbc544b5a4d82ff5b"], | |
169 | "user": "foobar" |
|
169 | "user": "foobar" | |
170 |
} |
|
170 | }, | |
171 | { |
|
171 | { | |
172 | "command": "commit -Aqm a", |
|
172 | "command": "commit -Aqm a", | |
173 | "date": "1970-01-01 00:00 +0000", |
|
173 | "date": "1970-01-01 00:00 +0000", | |
174 | "name": ".", |
|
174 | "name": ".", | |
175 | "newhashes": "cb9a9f314b8b07ba71012fcdbc544b5a4d82ff5b", |
|
175 | "newhashes": ["cb9a9f314b8b07ba71012fcdbc544b5a4d82ff5b"], | |
176 | "oldhashes": "0000000000000000000000000000000000000000", |
|
176 | "oldhashes": ["0000000000000000000000000000000000000000"], | |
177 | "user": "foobar" |
|
177 | "user": "foobar" | |
178 | } |
|
178 | } | |
179 |
|
|
179 | ] | |
|
180 | ||||
|
181 | $ cat <<EOF >> $HGRCPATH | |||
|
182 | > [templates] | |||
|
183 | > j = "{oldhashes % '{node|upper}'} -> {newhashes % '{node|upper}'} | |||
|
184 | > - user: {user} | |||
|
185 | > - command: {command} | |||
|
186 | > - newhashes: {newhashes} | |||
|
187 | > - oldhashes: {oldhashes} | |||
|
188 | > " | |||
|
189 | > EOF | |||
|
190 | $ hg journal -Tj -l1 | |||
|
191 | previous locations of '.': | |||
|
192 | CB9A9F314B8B07BA71012FCDBC544B5A4D82FF5B -> 1E6C11564562B4ED919BACA798BC4338BD299D6A | |||
|
193 | - user: foobar | |||
|
194 | - command: up | |||
|
195 | - newhashes: 1e6c11564562b4ed919baca798bc4338bd299d6a | |||
|
196 | - oldhashes: cb9a9f314b8b07ba71012fcdbc544b5a4d82ff5b | |||
|
197 | ||||
180 |
$ |
|
198 | $ hg journal --commit | |
181 | previous locations of '.': |
|
199 | previous locations of '.': | |
182 | 1e6c11564562 up |
|
200 | 1e6c11564562 up |
General Comments 0
You need to be logged in to leave comments.
Login now