##// END OF EJS Templates
journal: use fm.formatlist() to pass hashes in appropriate type (BC)
Yuya Nishihara -
r29677:69890b5d default
parent child Browse files
Show More
@@ -475,8 +475,10 b' def journal(ui, repo, *args, **opts):'
475 475 for count, entry in enumerate(repo.journal.filtered(name=name)):
476 476 if count == limit:
477 477 break
478 newhashesstr = ','.join([fm.hexfunc(hash) for hash in entry.newhashes])
479 oldhashesstr = ','.join([fm.hexfunc(hash) for hash in entry.oldhashes])
478 newhashesstr = fm.formatlist(map(fm.hexfunc, entry.newhashes),
479 name='node', sep=',')
480 oldhashesstr = fm.formatlist(map(fm.hexfunc, entry.oldhashes),
481 name='node', sep=',')
480 482
481 483 fm.startitem()
482 484 fm.condwrite(ui.verbose, 'oldhashes', '%s -> ', oldhashesstr)
@@ -130,7 +130,7 b' Test that you can list all entries as we'
130 130 cb9a9f314b8b bar book -f bar
131 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 135 $ hg journal --verbose --all
136 136 previous locations of the working copy and bookmarks:
@@ -148,35 +148,53 b' Test that verbose, JSON and commit outpu'
148 148 "command": "up",
149 149 "date": "1970-01-01 00:00 +0000",
150 150 "name": ".",
151 "newhashes": "1e6c11564562b4ed919baca798bc4338bd299d6a",
152 "oldhashes": "cb9a9f314b8b07ba71012fcdbc544b5a4d82ff5b",
151 "newhashes": ["1e6c11564562b4ed919baca798bc4338bd299d6a"],
152 "oldhashes": ["cb9a9f314b8b07ba71012fcdbc544b5a4d82ff5b"],
153 153 "user": "foobar"
154 154 },
155 155 {
156 156 "command": "up 0",
157 157 "date": "1970-01-01 00:00 +0000",
158 158 "name": ".",
159 "newhashes": "cb9a9f314b8b07ba71012fcdbc544b5a4d82ff5b",
160 "oldhashes": "1e6c11564562b4ed919baca798bc4338bd299d6a",
159 "newhashes": ["cb9a9f314b8b07ba71012fcdbc544b5a4d82ff5b"],
160 "oldhashes": ["1e6c11564562b4ed919baca798bc4338bd299d6a"],
161 161 "user": "foobar"
162 162 },
163 163 {
164 164 "command": "commit -Aqm b",
165 165 "date": "1970-01-01 00:00 +0000",
166 166 "name": ".",
167 "newhashes": "1e6c11564562b4ed919baca798bc4338bd299d6a",
168 "oldhashes": "cb9a9f314b8b07ba71012fcdbc544b5a4d82ff5b",
167 "newhashes": ["1e6c11564562b4ed919baca798bc4338bd299d6a"],
168 "oldhashes": ["cb9a9f314b8b07ba71012fcdbc544b5a4d82ff5b"],
169 169 "user": "foobar"
170 170 },
171 171 {
172 172 "command": "commit -Aqm a",
173 173 "date": "1970-01-01 00:00 +0000",
174 174 "name": ".",
175 "newhashes": "cb9a9f314b8b07ba71012fcdbc544b5a4d82ff5b",
176 "oldhashes": "0000000000000000000000000000000000000000",
175 "newhashes": ["cb9a9f314b8b07ba71012fcdbc544b5a4d82ff5b"],
176 "oldhashes": ["0000000000000000000000000000000000000000"],
177 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 199 previous locations of '.':
182 200 1e6c11564562 up
General Comments 0
You need to be logged in to leave comments. Login now