# HG changeset patch # User Vadim Gelfer # Date 1154016893 25200 # Node ID 8342c0286184e1871c084431093a2b5393d99fd3 # Parent 2ab464771b7d15c60014996d2853efc92cdb8465# Parent accadcb4e4b5615862d9bd6a52f04725b98b03d2 merge with crew. diff --git a/MANIFEST.in b/MANIFEST.in --- a/MANIFEST.in +++ b/MANIFEST.in @@ -10,6 +10,7 @@ include templates/*.tmpl include templates/static/* include doc/README doc/Makefile doc/gendoc.py doc/*.txt doc/*.html doc/*.[0-9] recursive-include contrib * +recursive-include hgext * include README include CONTRIBUTORS include COPYING diff --git a/doc/hgrc.5.txt b/doc/hgrc.5.txt --- a/doc/hgrc.5.txt +++ b/doc/hgrc.5.txt @@ -139,12 +139,13 @@ email:: Optional. Email address to use in "From" header and SMTP envelope of outgoing messages. to;; - Optional. Email address(es) of recipient(s). + Optional. Comma-separated list of recipients' email addresses. cc;; - Optional. Email address(es) to send carbon copies to. + Optional. Comma-separated list of carbon copy recipients' + email addresses. bcc;; - Optional. Email address(es) to send blind carbon copies to. - Cannot be set interactively. + Optional. Comma-separated list of blind carbon copy + recipients' email addresses. Cannot be set interactively. method;; Optional. Method to use to send email messages. If value is "smtp" (default), use SMTP (see section "[smtp]" for diff --git a/mercurial/hgweb/hgweb_mod.py b/mercurial/hgweb/hgweb_mod.py --- a/mercurial/hgweb/hgweb_mod.py +++ b/mercurial/hgweb/hgweb_mod.py @@ -48,6 +48,7 @@ class hgweb(object): self.repo = hg.repository(self.repo.ui, self.repo.root) self.maxchanges = int(self.repo.ui.config("web", "maxchanges", 10)) self.stripecount = int(self.repo.ui.config("web", "stripes", 1)) + self.maxshortchanges = int(self.repo.ui.config("web", "maxshortchanges", 60)) self.maxfiles = int(self.repo.ui.config("web", "maxfiles", 10)) self.allowpull = self.repo.ui.configbool("web", "allowpull", True) @@ -160,7 +161,7 @@ class hgweb(object): ignorewsamount=ignorewsamount, ignoreblanklines=ignoreblanklines), f, tn) - def changelog(self, pos): + def changelog(self, pos, shortlog=False): def changenav(**map): def seq(factor, maxchanges=None): if maxchanges: @@ -175,8 +176,9 @@ class hgweb(object): l = [] last = 0 - for f in seq(1, self.maxchanges): - if f < self.maxchanges or f <= last: + maxchanges = shortlog and self.maxshortchanges or self.maxchanges + for f in seq(1, maxchanges): + if f < maxchanges or f <= last: continue if f > count: break @@ -221,14 +223,15 @@ class hgweb(object): for e in l: yield e + maxchanges = shortlog and self.maxshortchanges or self.maxchanges cl = self.repo.changelog mf = cl.read(cl.tip())[0] count = cl.count() - start = max(0, pos - self.maxchanges + 1) - end = min(count, start + self.maxchanges) + start = max(0, pos - maxchanges + 1) + end = min(count, start + maxchanges) pos = end - 1 - yield self.t('changelog', + yield self.t(shortlog and 'shortlog' or 'changelog', changenav=changenav, manifest=hex(mf), rev=pos, changesets=count, entries=changelist, @@ -611,7 +614,8 @@ class hgweb(object): lastchange = (0, 0), # FIXME manifest = hex(mf), tags = tagentries, - shortlog = changelist) + shortlog = changelist, + archives=self.archivelist("tip")) def filediff(self, file, changeset): cl = self.repo.changelog @@ -691,6 +695,7 @@ class hgweb(object): def expand_form(form): shortcuts = { 'cl': [('cmd', ['changelog']), ('rev', None)], + 'sl': [('cmd', ['shortlog']), ('rev', None)], 'cs': [('cmd', ['changeset']), ('node', None)], 'f': [('cmd', ['file']), ('filenode', None)], 'fl': [('cmd', ['filelog']), ('filenode', None)], @@ -773,6 +778,18 @@ class hgweb(object): req.write(self.changelog(hi)) + def do_shortlog(self, req): + hi = self.repo.changelog.count() - 1 + if req.form.has_key('rev'): + hi = req.form['rev'][0] + try: + hi = self.repo.changelog.rev(self.repo.lookup(hi)) + except hg.RepoError: + req.write(self.search(hi)) # XXX redirect to 404 page? + return + + req.write(self.changelog(hi, shortlog = True)) + def do_changeset(self, req): req.write(self.changeset(req.form['node'][0])) diff --git a/templates/changelog-gitweb.tmpl b/templates/changelog-gitweb.tmpl --- a/templates/changelog-gitweb.tmpl +++ b/templates/changelog-gitweb.tmpl @@ -20,7 +20,7 @@ diff --git a/templates/changelog.tmpl b/templates/changelog.tmpl --- a/templates/changelog.tmpl +++ b/templates/changelog.tmpl @@ -6,6 +6,7 @@
+shortlog tags manifest #archives%archiveentry# diff --git a/templates/changeset-gitweb.tmpl b/templates/changeset-gitweb.tmpl --- a/templates/changeset-gitweb.tmpl +++ b/templates/changeset-gitweb.tmpl @@ -10,7 +10,7 @@
diff --git a/templates/changeset.tmpl b/templates/changeset.tmpl --- a/templates/changeset.tmpl +++ b/templates/changeset.tmpl @@ -5,6 +5,7 @@
changelog +shortlog tags manifest raw diff --git a/templates/error-gitweb.tmpl b/templates/error-gitweb.tmpl --- a/templates/error-gitweb.tmpl +++ b/templates/error-gitweb.tmpl @@ -10,7 +10,7 @@
diff --git a/templates/fileannotate-gitweb.tmpl b/templates/fileannotate-gitweb.tmpl --- a/templates/fileannotate-gitweb.tmpl +++ b/templates/fileannotate-gitweb.tmpl @@ -10,7 +10,7 @@
#file|escape#
diff --git a/templates/fileannotate.tmpl b/templates/fileannotate.tmpl --- a/templates/fileannotate.tmpl +++ b/templates/fileannotate.tmpl @@ -5,6 +5,7 @@
changelog +shortlog tags changeset manifest diff --git a/templates/filediff.tmpl b/templates/filediff.tmpl --- a/templates/filediff.tmpl +++ b/templates/filediff.tmpl @@ -5,6 +5,7 @@
changelog +shortlog tags changeset file diff --git a/templates/filelog-gitweb.tmpl b/templates/filelog-gitweb.tmpl --- a/templates/filelog-gitweb.tmpl +++ b/templates/filelog-gitweb.tmpl @@ -10,7 +10,7 @@
#file|urlescape#
diff --git a/templates/filelog.tmpl b/templates/filelog.tmpl --- a/templates/filelog.tmpl +++ b/templates/filelog.tmpl @@ -8,6 +8,7 @@
changelog +shortlog tags file annotate diff --git a/templates/filerevision-gitweb.tmpl b/templates/filerevision-gitweb.tmpl --- a/templates/filerevision-gitweb.tmpl +++ b/templates/filerevision-gitweb.tmpl @@ -10,7 +10,7 @@
#file|escape#
diff --git a/templates/filerevision.tmpl b/templates/filerevision.tmpl --- a/templates/filerevision.tmpl +++ b/templates/filerevision.tmpl @@ -5,6 +5,7 @@
changelog +shortlog tags changeset manifest diff --git a/templates/manifest-gitweb.tmpl b/templates/manifest-gitweb.tmpl --- a/templates/manifest-gitweb.tmpl +++ b/templates/manifest-gitweb.tmpl @@ -10,7 +10,7 @@
#path|escape#
diff --git a/templates/manifest.tmpl b/templates/manifest.tmpl --- a/templates/manifest.tmpl +++ b/templates/manifest.tmpl @@ -5,6 +5,7 @@
changelog +shortlog tags changeset #archives%archiveentry# diff --git a/templates/map b/templates/map --- a/templates/map +++ b/templates/map @@ -3,7 +3,10 @@ header = header.tmpl footer = footer.tmpl search = search.tmpl changelog = changelog.tmpl +shortlog = shortlog.tmpl +shortlogentry = shortlogentry.tmpl naventry = '#label|escape# ' +navshortentry = '#label|escape# ' filedifflink = '#file|escape# ' filenodelink = '#file|escape# ' fileellipses = '...' diff --git a/templates/search-gitweb.tmpl b/templates/search-gitweb.tmpl --- a/templates/search-gitweb.tmpl +++ b/templates/search-gitweb.tmpl @@ -1,6 +1,6 @@ #header#

searching for #query|escape#

diff --git a/templates/search.tmpl b/templates/search.tmpl --- a/templates/search.tmpl +++ b/templates/search.tmpl @@ -5,6 +5,7 @@ diff --git a/templates/shortlog-gitweb.tmpl b/templates/shortlog-gitweb.tmpl --- a/templates/shortlog-gitweb.tmpl +++ b/templates/shortlog-gitweb.tmpl @@ -1,13 +1,32 @@ #header# +#repo|escape#: Shortlog + + + + + +
+ +
+
-#entries# +#entries%shortlogentry#
#footer# diff --git a/templates/shortlog.tmpl b/templates/shortlog.tmpl new file mode 100644 --- /dev/null +++ b/templates/shortlog.tmpl @@ -0,0 +1,38 @@ +#header# +#repo|escape#: shortlog + + + + +
+changelog +tags +manifest +#archives%archiveentry# +rss +
+ +

shortlog for #repo|escape#

+ +
+

+ + + +navigate: #changenav%navshortentry# +

+
+ +#entries%shortlogentry# + +
+

+ + + +navigate: #changenav%navshortentry# +

+
+ +#footer# diff --git a/templates/shortlogentry.tmpl b/templates/shortlogentry.tmpl new file mode 100644 --- /dev/null +++ b/templates/shortlogentry.tmpl @@ -0,0 +1,7 @@ + + + + + + +
#date|age##author|obfuscate##desc|strip|firstline|escape#
diff --git a/templates/static/style.css b/templates/static/style.css --- a/templates/static/style.css +++ b/templates/static/style.css @@ -57,6 +57,12 @@ pre { margin: 0; } .logEntry th.age, .logEntry th.firstline { font-weight: bold; } .logEntry th.firstline { text-align: left; width: inherit; } +/* Shortlog entries */ +.slogEntry { width: 100%; font-size: smaller; } +.slogEntry .age { width: 7%; } +.slogEntry td { font-weight: normal; text-align: left; vertical-align: top; } +.slogEntry td.author { width: 35%; } + /* Tag entries */ #tagEntries { list-style: none; margin: 0; padding: 0; } #tagEntries .tagEntry { list-style: none; margin: 0; padding: 0; } diff --git a/templates/summary-gitweb.tmpl b/templates/summary-gitweb.tmpl --- a/templates/summary-gitweb.tmpl +++ b/templates/summary-gitweb.tmpl @@ -9,7 +9,8 @@
Mercurial
#repo|escape# / summary
 
diff --git a/templates/tags-gitweb.tmpl b/templates/tags-gitweb.tmpl --- a/templates/tags-gitweb.tmpl +++ b/templates/tags-gitweb.tmpl @@ -10,7 +10,7 @@
diff --git a/templates/tags.tmpl b/templates/tags.tmpl --- a/templates/tags.tmpl +++ b/templates/tags.tmpl @@ -7,6 +7,7 @@
changelog +shortlog manifest rss