Mercurial > public > mercurial-scm > hg
comparison mercurial/ui.py @ 29366:d269e7db2f55
ui: provide official way to reset internal state per command
This will allow us to clear in-memory password storage per runcommand().
I've updated commandserver to call resetstate() of both ui and repo.ui because
they may have different states in theory.
author | Yuya Nishihara <yuya@tcha.org> |
---|---|
date | Sun, 12 Jun 2016 14:07:26 +0900 |
parents | e9ce33c642e8 |
children | fea71f66ebff |
comparison
equal
deleted
inserted
replaced
29365:f652e84f23f2 | 29366:d269e7db2f55 |
---|---|
135 for f in scmutil.rcpath(): | 135 for f in scmutil.rcpath(): |
136 self.readconfig(f, trust=True) | 136 self.readconfig(f, trust=True) |
137 | 137 |
138 def copy(self): | 138 def copy(self): |
139 return self.__class__(self) | 139 return self.__class__(self) |
140 | |
141 def resetstate(self): | |
142 """Clear internal state that shouldn't persist across commands""" | |
143 if self._progbar: | |
144 self._progbar.resetstate() # reset last-print time of progress bar | |
140 | 145 |
141 def formatter(self, topic, opts): | 146 def formatter(self, topic, opts): |
142 return formatter.formatter(self, topic, opts) | 147 return formatter.formatter(self, topic, opts) |
143 | 148 |
144 def _trusted(self, fp, f): | 149 def _trusted(self, fp, f): |