114 morevars = copy.copy(tmpl.defaults['sessionvars']) |
114 morevars = copy.copy(tmpl.defaults['sessionvars']) |
115 morevars['revcount'] = revcount * 2 |
115 morevars['revcount'] = revcount * 2 |
116 morevars['rev'] = query |
116 morevars['rev'] = query |
117 |
117 |
118 def changelist(**map): |
118 def changelist(**map): |
119 cl = web.repo.changelog |
|
120 count = 0 |
119 count = 0 |
121 qw = query.lower().split() |
120 qw = query.lower().split() |
122 |
121 |
123 def revgen(): |
122 def revgen(): |
124 for i in xrange(len(cl) - 1, 0, -100): |
123 for i in xrange(len(web.repo) - 1, 0, -100): |
125 l = [] |
124 l = [] |
126 for j in xrange(max(0, i - 100), i + 1): |
125 for j in xrange(max(0, i - 100), i + 1): |
127 ctx = web.repo[j] |
126 ctx = web.repo[j] |
128 l.append(ctx) |
127 l.append(ctx) |
129 l.reverse() |
128 l.reverse() |
162 branches=webutil.nodebranchdict(web.repo, ctx)) |
161 branches=webutil.nodebranchdict(web.repo, ctx)) |
163 |
162 |
164 if count >= revcount: |
163 if count >= revcount: |
165 break |
164 break |
166 |
165 |
167 cl = web.repo.changelog |
166 tip = web.repo['tip'] |
168 parity = paritygen(web.stripecount) |
167 parity = paritygen(web.stripecount) |
169 |
168 |
170 return tmpl('search', query=query, node=hex(cl.tip()), |
169 return tmpl('search', query=query, node=tip.hex(), |
171 entries=changelist, archives=web.archivelist("tip"), |
170 entries=changelist, archives=web.archivelist("tip"), |
172 morevars=morevars, lessvars=lessvars) |
171 morevars=morevars, lessvars=lessvars) |
173 |
172 |
174 def changelog(web, req, tmpl, shortlog=False): |
173 def changelog(web, req, tmpl, shortlog=False): |
175 |
174 |
222 lessvars = copy.copy(tmpl.defaults['sessionvars']) |
221 lessvars = copy.copy(tmpl.defaults['sessionvars']) |
223 lessvars['revcount'] = revcount / 2 |
222 lessvars['revcount'] = revcount / 2 |
224 morevars = copy.copy(tmpl.defaults['sessionvars']) |
223 morevars = copy.copy(tmpl.defaults['sessionvars']) |
225 morevars['revcount'] = revcount * 2 |
224 morevars['revcount'] = revcount * 2 |
226 |
225 |
227 cl = web.repo.changelog |
226 count = len(web.repo) |
228 count = len(cl) |
|
229 pos = ctx.rev() |
227 pos = ctx.rev() |
230 start = max(0, pos - revcount + 1) |
228 start = max(0, pos - revcount + 1) |
231 end = min(count, start + revcount) |
229 end = min(count, start + revcount) |
232 pos = end - 1 |
230 pos = end - 1 |
233 parity = paritygen(web.stripecount, offset=start - end) |
231 parity = paritygen(web.stripecount, offset=start - end) |
465 inbranch=webutil.nodeinbranch(web.repo, ctx), |
463 inbranch=webutil.nodeinbranch(web.repo, ctx), |
466 branches=webutil.nodebranchdict(web.repo, ctx))) |
464 branches=webutil.nodebranchdict(web.repo, ctx))) |
467 |
465 |
468 yield l |
466 yield l |
469 |
467 |
470 cl = web.repo.changelog |
468 tip = web.repo['tip'] |
471 count = len(cl) |
469 count = len(web.repo) |
472 start = max(0, count - web.maxchanges) |
470 start = max(0, count - web.maxchanges) |
473 end = min(count, start + web.maxchanges) |
471 end = min(count, start + web.maxchanges) |
474 |
472 |
475 return tmpl("summary", |
473 return tmpl("summary", |
476 desc=web.config("web", "description", "unknown"), |
474 desc=web.config("web", "description", "unknown"), |
477 owner=get_contact(web.config) or "unknown", |
475 owner=get_contact(web.config) or "unknown", |
478 lastchange=cl.read(cl.tip())[2], |
476 lastchange=tip.date(), |
479 tags=tagentries, |
477 tags=tagentries, |
480 branches=branches, |
478 branches=branches, |
481 shortlog=changelist, |
479 shortlog=changelist, |
482 node=hex(cl.tip()), |
480 node=tip.hex(), |
483 archives=web.archivelist("tip")) |
481 archives=web.archivelist("tip")) |
484 |
482 |
485 def filediff(web, req, tmpl): |
483 def filediff(web, req, tmpl): |
486 fctx, ctx = None, None |
484 fctx, ctx = None, None |
487 try: |
485 try: |