246 fctx = repo[changeid][path] |
246 fctx = repo[changeid][path] |
247 except error.RepoError: |
247 except error.RepoError: |
248 fctx = repo.filectx(path, fileid=changeid) |
248 fctx = repo.filectx(path, fileid=changeid) |
249 |
249 |
250 return fctx |
250 return fctx |
|
251 |
|
252 def changelistentry(web, ctx, tmpl): |
|
253 '''Obtain a dictionary to be used for entries in a changelist. |
|
254 |
|
255 This function is called when producing items for the "entries" list passed |
|
256 to the "shortlog" and "changelog" templates. |
|
257 ''' |
|
258 repo = web.repo |
|
259 rev = ctx.rev() |
|
260 n = ctx.node() |
|
261 showtags = showtag(repo, tmpl, 'changelogtag', n) |
|
262 files = listfilediffs(tmpl, ctx.files(), n, web.maxfiles) |
|
263 |
|
264 return { |
|
265 "author": ctx.user(), |
|
266 "parent": parents(ctx, rev - 1), |
|
267 "child": children(ctx, rev + 1), |
|
268 "changelogtag": showtags, |
|
269 "desc": ctx.description(), |
|
270 "extra": ctx.extra(), |
|
271 "date": ctx.date(), |
|
272 "files": files, |
|
273 "rev": rev, |
|
274 "node": hex(n), |
|
275 "tags": nodetagsdict(repo, n), |
|
276 "bookmarks": nodebookmarksdict(repo, n), |
|
277 "inbranch": nodeinbranch(repo, ctx), |
|
278 "branches": nodebranchdict(repo, ctx) |
|
279 } |
251 |
280 |
252 def listfilediffs(tmpl, files, node, max): |
281 def listfilediffs(tmpl, files, node, max): |
253 for f in files[:max]: |
282 for f in files[:max]: |
254 yield tmpl('filedifflink', node=hex(node), file=f) |
283 yield tmpl('filedifflink', node=hex(node), file=f) |
255 if len(files) > max: |
284 if len(files) > max: |