Patchwork [15,of,15,V3] hgweb: run with "served" filter

login
register
mail settings
Submitter Pierre-Yves David
Date Jan. 16, 2013, 1:32 p.m.
Message ID <ac620972fbdc7daeda5a.1358343141@crater2.logilab.fr>
Download mbox | patch
Permalink /patch/653/
State Accepted
Delegated to: Kevin Bullock
Headers show

Comments

Pierre-Yves David - Jan. 16, 2013, 1:32 p.m.
# HG changeset patch
# User Pierre-Yves David <pierre-yves.david@logilab.fr>
# Date 1358285696 -3600
# Node ID ac620972fbdc7daeda5a6e8431a071b919616294
# Parent  5e2bf063c4631d126fde397a26e0bbce057a8913
hgweb: run with "served" filter

This changeset enable the "served" filter on all repo used by hgweb.

Hgweb misbehave in a lot of when filtering changeset are present but I do not
expect normal people to have secret or obsolete changeset on they server.
Misbehavior will be gradually fixed later.
Matt Mackall - Jan. 17, 2013, 7:30 p.m.
On Wed, 2013-01-16 at 14:32 +0100, pierre-yves.david@logilab.fr wrote:
> # HG changeset patch
> # User Pierre-Yves David <pierre-yves.david@logilab.fr>
> # Date 1358285696 -3600
> # Node ID ac620972fbdc7daeda5a6e8431a071b919616294
> # Parent  5e2bf063c4631d126fde397a26e0bbce057a8913
> hgweb: run with "served" filter

These are queued for default, thanks.

Patch

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
@@ -57,10 +57,11 @@  class hgweb(object):
                 u = ui.ui()
             self.repo = hg.repository(u, repo)
         else:
             self.repo = repo
 
+        self.repo =  self.repo.filtered('served')
         self.repo.ui.setconfig('ui', 'report_untrusted', 'off')
         self.repo.ui.setconfig('ui', 'nontty', 'true')
         hook.redirect(True)
         self.mtime = -1
         self.size = -1
@@ -93,10 +94,11 @@  class hgweb(object):
         # rollbacks made less than a second ago
         if st.st_mtime != self.mtime or st.st_size != self.size:
             self.mtime = st.st_mtime
             self.size = st.st_size
             self.repo = hg.repository(self.repo.ui, self.repo.root)
+            self.repo =  self.repo.filtered('served')
             self.maxchanges = int(self.config("web", "maxchanges", 10))
             self.stripecount = int(self.config("web", "stripes", 1))
             self.maxshortchanges = int(self.config("web", "maxshortchanges",
                                                    60))
             self.maxfiles = int(self.config("web", "maxfiles", 10))