[PATCH 1 of 7] hgweb: prefix private variables of sessionvars with '_'

Yuya Nishihara yuya at tcha.org
Sat Apr 14 12:49:11 UTC 2018


# HG changeset patch
# User Yuya Nishihara <yuya at tcha.org>
# Date 1522591382 -32400
#      Sun Apr 01 23:03:02 2018 +0900
# Node ID 7b406ab5b3e9c3da9527a3001ba62e29506bd73a
# Parent  34cde18a454484a1cf6e716a3325ca9282277d59
hgweb: prefix private variables of sessionvars with '_'

diff --git a/mercurial/hgweb/webutil.py b/mercurial/hgweb/webutil.py
--- a/mercurial/hgweb/webutil.py
+++ b/mercurial/hgweb/webutil.py
@@ -653,17 +653,17 @@ def diffstat(tmpl, ctx, statgen, parity)
 
 class sessionvars(object):
     def __init__(self, vars, start='?'):
-        self.start = start
-        self.vars = vars
+        self._start = start
+        self._vars = vars
     def __getitem__(self, key):
-        return self.vars[key]
+        return self._vars[key]
     def __setitem__(self, key, value):
-        self.vars[key] = value
+        self._vars[key] = value
     def __copy__(self):
-        return sessionvars(copy.copy(self.vars), self.start)
+        return sessionvars(copy.copy(self._vars), self._start)
     def __iter__(self):
-        separator = self.start
-        for key, value in sorted(self.vars.iteritems()):
+        separator = self._start
+        for key, value in sorted(self._vars.iteritems()):
             yield {'name': key,
                    'value': pycompat.bytestr(value),
                    'separator': separator,


More information about the Mercurial-devel mailing list