##// END OF EJS Templates
merge gitweb with crew
Benoit Boissinot -
r2685:2edfd664 merge default
parent child Browse files
Show More
@@ -48,6 +48,7 b' class hgweb(object):'
48 self.repo = hg.repository(self.repo.ui, self.repo.root)
48 self.repo = hg.repository(self.repo.ui, self.repo.root)
49 self.maxchanges = int(self.repo.ui.config("web", "maxchanges", 10))
49 self.maxchanges = int(self.repo.ui.config("web", "maxchanges", 10))
50 self.stripecount = int(self.repo.ui.config("web", "stripes", 1))
50 self.stripecount = int(self.repo.ui.config("web", "stripes", 1))
51 self.maxshortchanges = int(self.repo.ui.config("web", "maxshortchanges", 60))
51 self.maxfiles = int(self.repo.ui.config("web", "maxfiles", 10))
52 self.maxfiles = int(self.repo.ui.config("web", "maxfiles", 10))
52 self.allowpull = self.repo.ui.configbool("web", "allowpull", True)
53 self.allowpull = self.repo.ui.configbool("web", "allowpull", True)
53
54
@@ -160,7 +161,7 b' class hgweb(object):'
160 ignorewsamount=ignorewsamount,
161 ignorewsamount=ignorewsamount,
161 ignoreblanklines=ignoreblanklines), f, tn)
162 ignoreblanklines=ignoreblanklines), f, tn)
162
163
163 def changelog(self, pos):
164 def changelog(self, pos, shortlog=False):
164 def changenav(**map):
165 def changenav(**map):
165 def seq(factor, maxchanges=None):
166 def seq(factor, maxchanges=None):
166 if maxchanges:
167 if maxchanges:
@@ -175,8 +176,9 b' class hgweb(object):'
175
176
176 l = []
177 l = []
177 last = 0
178 last = 0
178 for f in seq(1, self.maxchanges):
179 maxchanges = shortlog and self.maxshortchanges or self.maxchanges
179 if f < self.maxchanges or f <= last:
180 for f in seq(1, maxchanges):
181 if f < maxchanges or f <= last:
180 continue
182 continue
181 if f > count:
183 if f > count:
182 break
184 break
@@ -221,14 +223,15 b' class hgweb(object):'
221 for e in l:
223 for e in l:
222 yield e
224 yield e
223
225
226 maxchanges = shortlog and self.maxshortchanges or self.maxchanges
224 cl = self.repo.changelog
227 cl = self.repo.changelog
225 mf = cl.read(cl.tip())[0]
228 mf = cl.read(cl.tip())[0]
226 count = cl.count()
229 count = cl.count()
227 start = max(0, pos - self.maxchanges + 1)
230 start = max(0, pos - maxchanges + 1)
228 end = min(count, start + self.maxchanges)
231 end = min(count, start + maxchanges)
229 pos = end - 1
232 pos = end - 1
230
233
231 yield self.t('changelog',
234 yield self.t(shortlog and 'shortlog' or 'changelog',
232 changenav=changenav,
235 changenav=changenav,
233 manifest=hex(mf),
236 manifest=hex(mf),
234 rev=pos, changesets=count, entries=changelist,
237 rev=pos, changesets=count, entries=changelist,
@@ -611,7 +614,8 b' class hgweb(object):'
611 lastchange = (0, 0), # FIXME
614 lastchange = (0, 0), # FIXME
612 manifest = hex(mf),
615 manifest = hex(mf),
613 tags = tagentries,
616 tags = tagentries,
614 shortlog = changelist)
617 shortlog = changelist,
618 archives=self.archivelist("tip"))
615
619
616 def filediff(self, file, changeset):
620 def filediff(self, file, changeset):
617 cl = self.repo.changelog
621 cl = self.repo.changelog
@@ -691,6 +695,7 b' class hgweb(object):'
691 def expand_form(form):
695 def expand_form(form):
692 shortcuts = {
696 shortcuts = {
693 'cl': [('cmd', ['changelog']), ('rev', None)],
697 'cl': [('cmd', ['changelog']), ('rev', None)],
698 'sl': [('cmd', ['shortlog']), ('rev', None)],
694 'cs': [('cmd', ['changeset']), ('node', None)],
699 'cs': [('cmd', ['changeset']), ('node', None)],
695 'f': [('cmd', ['file']), ('filenode', None)],
700 'f': [('cmd', ['file']), ('filenode', None)],
696 'fl': [('cmd', ['filelog']), ('filenode', None)],
701 'fl': [('cmd', ['filelog']), ('filenode', None)],
@@ -773,6 +778,18 b' class hgweb(object):'
773
778
774 req.write(self.changelog(hi))
779 req.write(self.changelog(hi))
775
780
781 def do_shortlog(self, req):
782 hi = self.repo.changelog.count() - 1
783 if req.form.has_key('rev'):
784 hi = req.form['rev'][0]
785 try:
786 hi = self.repo.changelog.rev(self.repo.lookup(hi))
787 except hg.RepoError:
788 req.write(self.search(hi)) # XXX redirect to 404 page?
789 return
790
791 req.write(self.changelog(hi, shortlog = True))
792
776 def do_changeset(self, req):
793 def do_changeset(self, req):
777 req.write(self.changeset(req.form['node'][0]))
794 req.write(self.changeset(req.form['node'][0]))
778
795
@@ -20,7 +20,7 b''
20 </div>
20 </div>
21
21
22 <div class="page_nav">
22 <div class="page_nav">
23 <a href="?cmd=summary;style=gitweb">summary</a> | changelog | <a href="?cmd=tags;style=gitweb">tags</a> | <a href="?cmd=manifest;manifest=#manifest#;path=/;style=gitweb">manifest</a><br/>
23 <a href="?cmd=summary;style=gitweb">summary</a> | <a href="?cmd=shortlog;rev=#rev#;style=gitweb">shortlog</a> | changelog | <a href="?cmd=tags;style=gitweb">tags</a> | <a href="?cmd=manifest;manifest=#manifest#;path=/;style=gitweb">manifest</a>#archives%archiveentry#<br/>
24 <br/>
24 <br/>
25 #changenav%naventry#<br/>
25 #changenav%naventry#<br/>
26 </div>
26 </div>
@@ -10,7 +10,7 b''
10 </div>
10 </div>
11
11
12 <div class="page_nav">
12 <div class="page_nav">
13 <a href="?cmd=summary;style=gitweb">summary</a> | <a href="?cmd=changelog;rev=#rev#;style=gitweb">changelog</a> | <a href="?cmd=tags;style=gitweb">tags</a> | <a href="?cmd=manifest;manifest=#manifest#;path=/;style=gitweb">manifest</a> | changeset | <a href="?cmd=changeset;node=#node#;style=raw">raw</a> #archives%archiveentry#<br/>
13 <a href="?cmd=summary;style=gitweb">summary</a> | <a href="?cmd=shortlog;rev=#rev#;style=gitweb">shortlog</a> | <a href="?cmd=changelog;rev=#rev#;style=gitweb">changelog</a> | <a href="?cmd=tags;style=gitweb">tags</a> | <a href="?cmd=manifest;manifest=#manifest#;path=/;style=gitweb">manifest</a> | changeset | <a href="?cmd=changeset;node=#node#;style=raw">raw</a> #archives%archiveentry#<br/>
14 </div>
14 </div>
15
15
16 <div>
16 <div>
@@ -10,7 +10,7 b''
10 </div>
10 </div>
11
11
12 <div class="page_nav">
12 <div class="page_nav">
13 <a href="?cmd=summary;style=gitweb">summary</a> | <a href="?cmd=changelog;style=gitweb">changelog</a> | <a href="?cmd=tags;style=gitweb">tags</a> | <a href="?cmd=manifest;manifest=#manifest#;path=/;style=gitweb">manifest</a><br/>
13 <a href="?cmd=summary;style=gitweb">summary</a> | <a href="?cmd=shortlog;style=gitweb">shortlog</a> | <a href="?cmd=changelog;style=gitweb">changelog</a> | <a href="?cmd=tags;style=gitweb">tags</a> | <a href="?cmd=manifest;manifest=#manifest#;path=/;style=gitweb">manifest</a><br/>
14 </div>
14 </div>
15
15
16 <div>
16 <div>
@@ -10,7 +10,7 b''
10 </div>
10 </div>
11
11
12 <div class="page_nav">
12 <div class="page_nav">
13 <a href="?cmd=summary;style=gitweb">summary</a> | <a href="?cmd=changelog;style=gitweb">changelog</a> | <a href="?cmd=tags;style=gitweb">tags</a> | <a href="?cmd=manifest;manifest=#manifest#;path=#path|urlescape#;style=gitweb">manifest</a> | <a href="?cmd=changeset;node=#node#;style=gitweb">changeset</a> | <a href="?cmd=file;file=#file|urlescape#;filenode=#filenode#;style=gitweb">file</a> | <a href="?cmd=filelog;file=#file|urlescape#;filenode=#filenode#;style=gitweb">revisions</a> | annotate | <a href="?cmd=annotate;file=#file|urlescape#;filenode=#filenode#;style=raw">raw</a><br/>
13 <a href="?cmd=summary;style=gitweb">summary</a> | <a href="?cmd=shortlog;style=gitweb">shortlog</a> | <a href="?cmd=changelog;style=gitweb">changelog</a> | <a href="?cmd=tags;style=gitweb">tags</a> | <a href="?cmd=manifest;manifest=#manifest#;path=#path|urlescape#;style=gitweb">manifest</a> | <a href="?cmd=changeset;node=#node#;style=gitweb">changeset</a> | <a href="?cmd=file;file=#file|urlescape#;filenode=#filenode#;style=gitweb">file</a> | <a href="?cmd=filelog;file=#file|urlescape#;filenode=#filenode#;style=gitweb">revisions</a> | annotate | <a href="?cmd=annotate;file=#file|urlescape#;filenode=#filenode#;style=raw">raw</a><br/>
14 </div>
14 </div>
15
15
16 <div class="title">#file|escape#</div>
16 <div class="title">#file|escape#</div>
@@ -10,7 +10,7 b''
10 </div>
10 </div>
11
11
12 <div class="page_nav">
12 <div class="page_nav">
13 <a href="?cmd=summary;style=gitweb">summary</a> | <a href="?cmd=changelog;style=gitweb">changelog</a> | <a href="?cmd=tags;style=gitweb">tags</a> | <a href="?cmd=file;file=#file|urlescape#;filenode=#filenode#;style=gitweb">file</a> | revisions | <a href="?cmd=annotate;file=#file|urlescape#;filenode=#filenode#;style=gitweb">annotate</a> | <a href="?fl=#filenode|short#;file=#file|urlescape#;style=rss">rss</a><br/>
13 <a href="?cmd=summary;style=gitweb">summary</a> | <a href="?cmd=shortlog;style=gitweb">shortlog</a> | <a href="?cmd=changelog;style=gitweb">changelog</a> | <a href="?cmd=tags;style=gitweb">tags</a> | <a href="?cmd=file;file=#file|urlescape#;filenode=#filenode#;style=gitweb">file</a> | revisions | <a href="?cmd=annotate;file=#file|urlescape#;filenode=#filenode#;style=gitweb">annotate</a> | <a href="?fl=#filenode|short#;file=#file|urlescape#;style=rss">rss</a><br/>
14 </div>
14 </div>
15
15
16 <div class="title" >#file|urlescape#</div>
16 <div class="title" >#file|urlescape#</div>
@@ -10,7 +10,7 b''
10 </div>
10 </div>
11
11
12 <div class="page_nav">
12 <div class="page_nav">
13 <a href="?cmd=summary;style=gitweb">summary</a> | <a href="?cmd=changelog;style=gitweb">changelog</a> | <a href="?cmd=tags;style=gitweb">tags</a> | <a href="?mf=#manifest|short#;path=#path|urlescape#;style=gitweb">manifest</a> | <a href="?cmd=changeset;node=#node#;style=gitweb">changeset</a> | file | <a href="?cmd=filelog;file=#file|urlescape#;filenode=#filenode#;style=gitweb">revisions</a> | <a href="?cmd=annotate;file=#file|urlescape#;filenode=#filenode#;style=gitweb">annotate</a> | <a href="?cmd=file;file=#file|urlescape#;filenode=#filenode#;style=raw">raw</a><br/>
13 <a href="?cmd=summary;style=gitweb">summary</a> | <a href="?cmd=shortlog;style=gitweb">shortlog</a> | <a href="?cmd=changelog;style=gitweb">changelog</a> | <a href="?cmd=tags;style=gitweb">tags</a> | <a href="?mf=#manifest|short#;path=#path|urlescape#;style=gitweb">manifest</a> | <a href="?cmd=changeset;node=#node#;style=gitweb">changeset</a> | file | <a href="?cmd=filelog;file=#file|urlescape#;filenode=#filenode#;style=gitweb">revisions</a> | <a href="?cmd=annotate;file=#file|urlescape#;filenode=#filenode#;style=gitweb">annotate</a> | <a href="?cmd=file;file=#file|urlescape#;filenode=#filenode#;style=raw">raw</a><br/>
14 </div>
14 </div>
15
15
16 <div class="title">#file|escape#</div>
16 <div class="title">#file|escape#</div>
@@ -10,7 +10,7 b''
10 </div>
10 </div>
11
11
12 <div class="page_nav">
12 <div class="page_nav">
13 <a href="?cmd=summary;style=gitweb">summary</a> | <a href="?cmd=changelog;style=gitweb">changelog</a> | <a href="?cmd=tags;style=gitweb">tags</a> | manifest | <a href="?cs=#node|short#;style=gitweb">changeset</a> #archives%archiveentry#<br/>
13 <a href="?cmd=summary;style=gitweb">summary</a> | <a href="?cmd=shortlog;style=gitweb">shortlog</a> | <a href="?cmd=changelog;style=gitweb">changelog</a> | <a href="?cmd=tags;style=gitweb">tags</a> | manifest | <a href="?cs=#node|short#;style=gitweb">changeset</a> #archives%archiveentry#<br/>
14 </div>
14 </div>
15
15
16 <div class="title" >#path|escape#</div>
16 <div class="title" >#path|escape#</div>
@@ -1,6 +1,6 b''
1 #header#
1 #header#
2 <div class="page_nav">
2 <div class="page_nav">
3 <a href="?cmd=summary;style=gitweb">summary</a> | log | <a href="?cmd=tags;style=gitweb">tags</a> | <a href="?cmd=manifest;manifest=#manifest#;path=/;style=gitweb">manifest</a><br/>
3 <a href="?cmd=summary;style=gitweb">summary</a> | <a href="?cmd=shortlog;style=gitweb">shortlog</a> | <a href="?cmd=changelog;style=gitweb">changelog</a> | <a href="?cmd=tags;style=gitweb">tags</a> | <a href="?cmd=manifest;manifest=#manifest#;path=/;style=gitweb">manifest</a><br/>
4 </div>
4 </div>
5
5
6 <h2>searching for #query|escape#</h2>
6 <h2>searching for #query|escape#</h2>
@@ -1,13 +1,32 b''
1 #header#
1 #header#
2 <title>#repo|escape#: Shortlog</title>
3 <link rel="alternate" type="application/rss+xml"
4 href="?cmd=changelog;style=rss" title="RSS feed for #repo|escape#">
5 </head>
6 <body>
2
7
8 <div class="page_header">
9 <a href="http://www.selenic.com/mercurial/" title="Mercurial"><div style="float:right;">Mercurial</div></a><a href="?cmd=summary;style=gitweb">#repo|escape#</a> / shortlog
10 </div>
11
12 <form action="#">
13 <div class="search">
14 <input type="hidden" name="repo" value="#repo|escape#" />
15 <input type="hidden" name="style" value="gitweb" />
16 <input type="hidden" name="cmd" value="changelog" />
17 <input type="text" name="rev" />
18 </div>
19 </form>
20 </div>
3 <div class="page_nav">
21 <div class="page_nav">
4 <a href="?cmd=summary;style=gitweb">summary</a> | <a href="?cmd=changelog;style=gitweb">log</a> | <a href="?cmd=tags;style=gitweb">tags</a> | <a href="?cmd=manifest;manifest=#manifest#;path=/;style=gitweb">manifest</a><br/>
22 <a href="?cmd=summary;style=gitweb">summary</a> | shortlog | <a href="?cmd=changelog;rev=#rev#;style=gitweb">changelog</a> | <a href="?cmd=tags;style=gitweb">tags</a> | <a href="?cmd=manifest;manifest=#manifest#;path=/;style=gitweb">manifest</a>#archives%archiveentry#<br/>
23 <br/>
5
24
6 #changenav%naventry#<br/>
25 #changenav%navshortentry#<br/>
7 </div>
26 </div>
8
27
9 <table cellspacing="0">
28 <table cellspacing="0">
10 #entries#
29 #entries%shortlogentry#
11 </table>
30 </table>
12
31
13 #footer#
32 #footer#
@@ -9,7 +9,8 b''
9 <a href="http://www.selenic.com/mercurial/" title="Mercurial"><div style="float:right;">Mercurial</div></a><a href="?cmd=summary;style=gitweb">#repo|escape#</a> / summary
9 <a href="http://www.selenic.com/mercurial/" title="Mercurial"><div style="float:right;">Mercurial</div></a><a href="?cmd=summary;style=gitweb">#repo|escape#</a> / summary
10 </div>
10 </div>
11 <div class="page_nav">
11 <div class="page_nav">
12 summary | <a href="?cmd=changelog;style=gitweb">changelog</a> | <a href="?cmd=tags;style=gitweb">tags</a> | <a href="?cmd=manifest;manifest=#manifest#;path=/;style=gitweb">manifest</a><br/>
12 summary | <a href="?cmd=shortlog;style=gitweb">shortlog</a> | <a href="?cmd=changelog;style=gitweb">changelog</a> | <a href="?cmd=tags;style=gitweb">tags</a> | <a href="?cmd=manifest;manifest=#manifest#;path=/;style=gitweb">manifest</a>#archives%archiveentry#
13 <br/>
13 </div>
14 </div>
14
15
15 <div class="title">&nbsp;</div>
16 <div class="title">&nbsp;</div>
@@ -10,7 +10,7 b''
10 </div>
10 </div>
11
11
12 <div class="page_nav">
12 <div class="page_nav">
13 <a href="?cmd=summary;style=gitweb">summary</a> | <a href="?cmd=changelog;style=gitweb">changelog</a> | tags | <a href="?cmd=manifest;manifest=#manifest#;path=/;style=gitweb">manifest</a>
13 <a href="?cmd=summary;style=gitweb">summary</a> | <a href="?cmd=shortlog;style=gitweb">shortlog</a> | <a href="?cmd=changelog;style=gitweb">changelog</a> | tags | <a href="?cmd=manifest;manifest=#manifest#;path=/;style=gitweb">manifest</a>
14 <br/>
14 <br/>
15 </div>
15 </div>
16
16
General Comments 0
You need to be logged in to leave comments. Login now