extensions: set attributes to wrappers so we can trace them back
This patch adds two attributes about the original function and the unbound
wrapper. It allows us to get a chain of wrappers. See the next patch.
ui: drop values returned by inspect.*frame*() to avoid cycles
"f = inspect.currentframe()" instantly creates a cycle because
"f.f_locals['f']" is "f" itself.
This patch explicitly sets those frame objects to None to avoid cycles.
dispatch: split global error handling out so it can be reused
We may want a similar error handling at worker.py. This patch extracts the
error handling logic to "callcatch" so it can be reused.
py3: conditionalize _winreg import
_winreg module is renamed to winreg in python 3. Added the conditionalize
statements in the respective file because adding this in pycompat will result
in pycompat throwing error as this is a windows registry module and we have
buildbots and most of the contributors on linux.
py3: conditionalize the raise statement
raise E,V,T is not acceptable in Python 3, thats is conditionalized.
Moreover this will result in syntax error so we have to use exec() to
execute this. Related PEP- https://www.python.org/dev/peps/pep-3109/#id14
My implementation is motivated from the six implementation except they are
defining a new function exec_() to prevent adding an extra frame AFAIK :)
https://bitbucket.org/gutworth/six/src/
ca4580a5a648/six.py#six.py-680
match: added matchessubrepo method to matcher
Previously there were three local implementations of this
function in cmdutil.files, cmdutil.remove and scmutil.addremove.
changegroup: move branch cache debug message to proper location
Before, we logged about performing a branch cache update when we
weren't actually doing it. Fix that.
journal: take wlock for writting the 'shared' file
As we did for the shared extension itself, we add some locking around the write
of the 'shared' file.
debugbuilddag: take wlock to cover '.hg/localtags'
This debug command can write local tags. local tags are in the .hg directory and
should be covered by the 'wlock'. This is now covered.
fakemergerecord: take wlock to write the merge state
The merge state is supposed to be covered by the wlock. We fix the test
extensions to comply to that.