Mercurial > hg
changeset 37695:570a4426c5b8
hgweb: make sessionvars class less dense
author | Yuya Nishihara <yuya@tcha.org> |
---|---|
date | Sun, 01 Apr 2018 23:03:58 +0900 |
parents | d14dbf46e5c7 |
children | 9ac3e97b299b |
files | mercurial/hgweb/webutil.py |
diffstat | 1 files changed, 4 insertions(+), 0 deletions(-) [+] |
line wrap: on
line diff
--- a/mercurial/hgweb/webutil.py Sun Apr 01 23:03:02 2018 +0900 +++ b/mercurial/hgweb/webutil.py Sun Apr 01 23:03:58 2018 +0900 @@ -655,12 +655,16 @@ def __init__(self, vars, start='?'): self._start = start self._vars = vars + def __getitem__(self, key): return self._vars[key] + def __setitem__(self, key, value): self._vars[key] = value + def __copy__(self): return sessionvars(copy.copy(self._vars), self._start) + def __iter__(self): separator = self._start for key, value in sorted(self._vars.iteritems()):