comparison mercurial/hgweb/webcommands.py @ 7311:de9c87fe1620

hgweb: move another utility function into the webutil module
author Dirkjan Ochtman <dirkjan@ochtman.nl>
date Mon, 03 Nov 2008 20:31:53 +0100
parents bd522d09d5e3
children 5c95d7667dd1
comparison
equal deleted inserted replaced
7310:bd522d09d5e3 7311:de9c87fe1620
128 continue 128 continue
129 129
130 count += 1 130 count += 1
131 n = ctx.node() 131 n = ctx.node()
132 showtags = webutil.showtag(web.repo, tmpl, 'changelogtag', n) 132 showtags = webutil.showtag(web.repo, tmpl, 'changelogtag', n)
133 files = webutil.listfilediffs(tmpl, ctx.files(), n, web.maxfiles)
133 134
134 yield tmpl('searchentry', 135 yield tmpl('searchentry',
135 parity=parity.next(), 136 parity=parity.next(),
136 author=ctx.user(), 137 author=ctx.user(),
137 parent=webutil.siblings(ctx.parents()), 138 parent=webutil.siblings(ctx.parents()),
138 child=webutil.siblings(ctx.children()), 139 child=webutil.siblings(ctx.children()),
139 changelogtag=showtags, 140 changelogtag=showtags,
140 desc=ctx.description(), 141 desc=ctx.description(),
141 date=ctx.date(), 142 date=ctx.date(),
142 files=web.listfilediffs(tmpl, ctx.files(), n), 143 files=files,
143 rev=ctx.rev(), 144 rev=ctx.rev(),
144 node=hex(n), 145 node=hex(n),
145 tags=webutil.nodetagsdict(web.repo, n), 146 tags=webutil.nodetagsdict(web.repo, n),
146 inbranch=webutil.nodeinbranch(web.repo, ctx), 147 inbranch=webutil.nodeinbranch(web.repo, ctx),
147 branches=webutil.nodebranchdict(web.repo, ctx)) 148 branches=webutil.nodebranchdict(web.repo, ctx))
176 l = [] # build a list in forward order for efficiency 177 l = [] # build a list in forward order for efficiency
177 for i in xrange(start, end): 178 for i in xrange(start, end):
178 ctx = web.repo[i] 179 ctx = web.repo[i]
179 n = ctx.node() 180 n = ctx.node()
180 showtags = webutil.showtag(web.repo, tmpl, 'changelogtag', n) 181 showtags = webutil.showtag(web.repo, tmpl, 'changelogtag', n)
182 files = webutil.listfilediffs(tmpl, ctx.files(), n, web.maxfiles)
181 183
182 l.insert(0, {"parity": parity.next(), 184 l.insert(0, {"parity": parity.next(),
183 "author": ctx.user(), 185 "author": ctx.user(),
184 "parent": webutil.siblings(ctx.parents(), i - 1), 186 "parent": webutil.siblings(ctx.parents(), i - 1),
185 "child": webutil.siblings(ctx.children(), i + 1), 187 "child": webutil.siblings(ctx.children(), i + 1),
186 "changelogtag": showtags, 188 "changelogtag": showtags,
187 "desc": ctx.description(), 189 "desc": ctx.description(),
188 "date": ctx.date(), 190 "date": ctx.date(),
189 "files": web.listfilediffs(tmpl, ctx.files(), n), 191 "files": files,
190 "rev": i, 192 "rev": i,
191 "node": hex(n), 193 "node": hex(n),
192 "tags": webutil.nodetagsdict(web.repo, n), 194 "tags": webutil.nodetagsdict(web.repo, n),
193 "inbranch": webutil.nodeinbranch(web.repo, ctx), 195 "inbranch": webutil.nodeinbranch(web.repo, ctx),
194 "branches": webutil.nodebranchdict(web.repo, ctx) 196 "branches": webutil.nodebranchdict(web.repo, ctx)