Patchwork [regression@default] statichttp: respect localrepo _restrictcapabilities

login
register
mail settings
Submitter Pierre-Yves David
Date April 7, 2014, 7:57 p.m.
Message ID <f5a95da9139f370e27ae.1396900666@marginatus.alto.octopoid.net>
Download mbox | patch
Permalink /patch/4243/
State Accepted
Commit af4158b8876ba11286467a8fa08fd19baf9e5a63
Headers show

Comments

Pierre-Yves David - April 7, 2014, 7:57 p.m.
# HG changeset patch
# User Pierre-Yves David <pierre-yves.david@fb.com>
# Date 1396896350 25200
#      Mon Apr 07 11:45:50 2014 -0700
# Node ID f5a95da9139f370e27aed1b2ec1e1b989899b8fd
# Parent  12f161f08d744f0e4b6eef9c905670afb5c24dd4
statichttp: respect localrepo _restrictcapabilities

The static http repository was doing his own filtering of capability ignoring
the filtering done in the local repo main class. This led to static http using
the current draft of bundle2. We now apply both.
Durham Goode - April 8, 2014, 8:07 p.m.
On 4/7/14, 12:57 PM, pierre-yves.david@ens-lyon.org wrote:
> # HG changeset patch
> # User Pierre-Yves David <pierre-yves.david@fb.com>
> # Date 1396896350 25200
> #      Mon Apr 07 11:45:50 2014 -0700
> # Node ID f5a95da9139f370e27aed1b2ec1e1b989899b8fd
> # Parent  12f161f08d744f0e4b6eef9c905670afb5c24dd4
> statichttp: respect localrepo _restrictcapabilities
>
> The static http repository was doing his own filtering of capability ignoring
> the filtering done in the local repo main class. This led to static http using
> the current draft of bundle2. We now apply both.
>
> diff --git a/mercurial/statichttprepo.py b/mercurial/statichttprepo.py
> --- a/mercurial/statichttprepo.py
> +++ b/mercurial/statichttprepo.py
> @@ -141,10 +141,11 @@ class statichttprepository(localrepo.loc
>           self._branchcaches = {}
>           self.encodepats = None
>           self.decodepats = None
>   
>       def _restrictcapabilities(self, caps):
> +        caps = super(statichttprepository, self)._restrictcapabilities(caps)
>           return caps.difference(["pushkey"])
>   
>       def url(self):
>           return self._url
>
Queued for default.  Also queued the trivial 
caps.remove()->caps.discard() fix in localrepo._restrictcapabilities 
that we discussed in person.

Patch

diff --git a/mercurial/statichttprepo.py b/mercurial/statichttprepo.py
--- a/mercurial/statichttprepo.py
+++ b/mercurial/statichttprepo.py
@@ -141,10 +141,11 @@  class statichttprepository(localrepo.loc
         self._branchcaches = {}
         self.encodepats = None
         self.decodepats = None
 
     def _restrictcapabilities(self, caps):
+        caps = super(statichttprepository, self)._restrictcapabilities(caps)
         return caps.difference(["pushkey"])
 
     def url(self):
         return self._url