Patchwork [22,of,22,V2-Series-D] hgweb: run with "unserved" filter

login
register
mail settings
Submitter Pierre-Yves David
Date Jan. 14, 2013, 8:35 p.m.
Message ID <f30baff6c74e86d26fa4.1358195754@yamac.lan>
Download mbox | patch
Permalink /patch/618/
State Superseded
Headers show

Comments

Pierre-Yves David - Jan. 14, 2013, 8:35 p.m.
# HG changeset patch
# User Pierre-Yves David <pierre-yves.david@logilab.fr>
# Date 1358195047 -3600
# Node ID f30baff6c74e86d26fa4cddb636e61dfcbcf7cdd
# Parent  cb0e659e3a904ae17a95bb662f2b1a9b36156b1e
hgweb: run with "unserved" filter

This changeset enable the "unserved" 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 of obsolete changeset on they server.
Misbehavior will be gradually fixed later.
Dave S - Jan. 14, 2013, 9:22 p.m.
On Mon, Jan 14, 2013 at 12:35 PM, Pierre-Yves David
<pierre-yves.david@ens-lyon.org> wrote:
> # HG changeset patch
> # User Pierre-Yves David <pierre-yves.david@logilab.fr>
> # Date 1358195047 -3600
> # Node ID f30baff6c74e86d26fa4cddb636e61dfcbcf7cdd
> # Parent  cb0e659e3a904ae17a95bb662f2b1a9b36156b1e
> hgweb: run with "unserved" filter
>
> This changeset enable the "unserved" 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 of obsolete changeset on they server.

"secret of ..."? Maybe this is "secret _or_ obsolete" ?

/dps

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('unserved')
         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('unserved')
             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))