Mercurial > hg
comparison mercurial/templatekw.py @ 10282:08a0f04b56bd
many, many trivial check-code fixups
author | Matt Mackall <mpm@selenic.com> |
---|---|
date | Mon, 25 Jan 2010 00:05:27 -0600 |
parents | d6512b3e9ac0 |
children | 4612cded5176 |
comparison
equal
deleted
inserted
replaced
10281:e7d3b509af8b | 10282:08a0f04b56bd |
---|---|
27 map, expand it instead of 'foo' for last key. | 27 map, expand it instead of 'foo' for last key. |
28 | 28 |
29 expand 'end_foos'. | 29 expand 'end_foos'. |
30 ''' | 30 ''' |
31 templ = args['templ'] | 31 templ = args['templ'] |
32 if plural: names = plural | 32 if plural: |
33 names = plural | |
33 else: names = name + 's' | 34 else: names = name + 's' |
34 if not values: | 35 if not values: |
35 noname = 'no_' + names | 36 noname = 'no_' + names |
36 if noname in templ: | 37 if noname in templ: |
37 yield templ(noname, **args) | 38 yield templ(noname, **args) |
186 getrenamed = cache['getrenamed'] | 187 getrenamed = cache['getrenamed'] |
187 for fn in ctx.files(): | 188 for fn in ctx.files(): |
188 rename = getrenamed(fn, ctx.rev()) | 189 rename = getrenamed(fn, ctx.rev()) |
189 if rename: | 190 if rename: |
190 copies.append((fn, rename[0])) | 191 copies.append((fn, rename[0])) |
191 | 192 |
192 c = [{'name': x[0], 'source': x[1]} for x in copies] | 193 c = [{'name': x[0], 'source': x[1]} for x in copies] |
193 return showlist('file_copy', c, plural='file_copies', **args) | 194 return showlist('file_copy', c, plural='file_copies', **args) |
194 | 195 |
195 # showfilecopiesswitch() displays file copies only if copy records are | 196 # showfilecopiesswitch() displays file copies only if copy records are |
196 # provided before calling the templater, usually with a --copies | 197 # provided before calling the templater, usually with a --copies |