Patchwork [3,of,3,V2,(resend)] localrepo: rename capability set to lower case

login
register
mail settings
Submitter Pierre-Yves David
Date March 18, 2014, 6:12 p.m.
Message ID <ce2ff3391990bff51a0a.1395166359@marginatus.alto.octopoid.net>
Download mbox | patch
Permalink /patch/3968/
State Accepted
Headers show

Comments

Pierre-Yves David - March 18, 2014, 6:12 p.m.
# HG changeset patch
# User Pierre-Yves David <pierre-yves.david@fb.com>
# Date 1394780525 25200
#      Fri Mar 14 00:02:05 2014 -0700
# Node ID ce2ff3391990bff51a0a667800d5e8391e46fac8
# Parent  90a13777b8ad1c1bed8263587596031c62d15e6e
localrepo: rename capability set to lower case.

This is not C and they are not even constant.
Matt Mackall - March 18, 2014, 7:30 p.m.
On Tue, 2014-03-18 at 11:12 -0700, pierre-yves.david@ens-lyon.org wrote:
> # HG changeset patch
> # User Pierre-Yves David <pierre-yves.david@fb.com>
> # Date 1394780525 25200
> #      Fri Mar 14 00:02:05 2014 -0700
> # Node ID ce2ff3391990bff51a0a667800d5e8391e46fac8
> # Parent  90a13777b8ad1c1bed8263587596031c62d15e6e
> localrepo: rename capability set to lower case.
> 
> This is not C and they are not even constant.

These are queued, but I had to hack evolve after this one.

Patch

diff --git a/mercurial/localrepo.py b/mercurial/localrepo.py
--- a/mercurial/localrepo.py
+++ b/mercurial/localrepo.py
@@ -60,17 +60,17 @@  def unfilteredmethod(orig):
     """decorate method that always need to be run on unfiltered version"""
     def wrapper(repo, *args, **kwargs):
         return orig(repo.unfiltered(), *args, **kwargs)
     return wrapper
 
-MODERNCAPS = set(('lookup', 'branchmap', 'pushkey', 'known', 'getbundle'))
-LEGACYCAPS = MODERNCAPS.union(set(['changegroupsubset']))
+moderncaps = set(('lookup', 'branchmap', 'pushkey', 'known', 'getbundle'))
+legacycaps = moderncaps.union(set(['changegroupsubset']))
 
 class localpeer(peer.peerrepository):
     '''peer for a local repo; reflects only the most recent API'''
 
-    def __init__(self, repo, caps=MODERNCAPS):
+    def __init__(self, repo, caps=moderncaps):
         peer.peerrepository.__init__(self)
         self._repo = repo.filtered('served')
         self.ui = repo.ui
         self._caps = repo._restrictcapabilities(caps)
         self.requirements = repo.requirements
@@ -129,11 +129,11 @@  class localpeer(peer.peerrepository):
 class locallegacypeer(localpeer):
     '''peer extension which implements legacy methods too; used for tests with
     restricted capabilities'''
 
     def __init__(self, repo):
-        localpeer.__init__(self, repo, caps=LEGACYCAPS)
+        localpeer.__init__(self, repo, caps=legacycaps)
 
     def branches(self, nodes):
         return self._repo.branches(nodes)
 
     def between(self, pairs):