comparison mercurial/templatekw.py @ 10058:c829563b3118

cmdutil: extract file copies closure into templatekw
author Patrick Mezard <pmezard@gmail.com>
date Sun, 13 Dec 2009 18:06:24 +0100
parents babc00a82c5e
children f780b1098efc
comparison
equal deleted inserted replaced
10057:babc00a82c5e 10058:c829563b3118
139 yield templ('extra', **args) 139 yield templ('extra', **args)
140 140
141 def showfileadds(repo, ctx, templ, revcache, **args): 141 def showfileadds(repo, ctx, templ, revcache, **args):
142 return showlist(templ, 'file_add', getfiles(repo, ctx, revcache)[1], **args) 142 return showlist(templ, 'file_add', getfiles(repo, ctx, revcache)[1], **args)
143 143
144 def showfilecopies(repo, ctx, templ, revcache, **args):
145 c = [{'name': x[0], 'source': x[1]} for x in revcache['copies']]
146 return showlist(templ, 'file_copy', c, plural='file_copies', **args)
147
144 def showfiledels(repo, ctx, templ, revcache, **args): 148 def showfiledels(repo, ctx, templ, revcache, **args):
145 return showlist(templ, 'file_del', getfiles(repo, ctx, revcache)[2], **args) 149 return showlist(templ, 'file_del', getfiles(repo, ctx, revcache)[2], **args)
146 150
147 def showfilemods(repo, ctx, templ, revcache, **args): 151 def showfilemods(repo, ctx, templ, revcache, **args):
148 return showlist(templ, 'file_mod', getfiles(repo, ctx, revcache)[0], **args) 152 return showlist(templ, 'file_mod', getfiles(repo, ctx, revcache)[0], **args)
177 'date': showdate, 181 'date': showdate,
178 'desc': showdescription, 182 'desc': showdescription,
179 'diffstat': showdiffstat, 183 'diffstat': showdiffstat,
180 'extras': showextras, 184 'extras': showextras,
181 'file_adds': showfileadds, 185 'file_adds': showfileadds,
186 'file_copies': showfilecopies,
182 'file_dels': showfiledels, 187 'file_dels': showfiledels,
183 'file_mods': showfilemods, 188 'file_mods': showfilemods,
184 'files': showfiles, 189 'files': showfiles,
185 'latesttag': showlatesttag, 190 'latesttag': showlatesttag,
186 'latesttagdistance': showlatesttagdistance, 191 'latesttagdistance': showlatesttagdistance,