mirror of
https://github.com/facebook/sapling.git
synced 2024-10-17 04:08:01 +03:00
A Scalable, User-Friendly Source Control System.
928dd2dd44
Summary: The less Python instructions in the `__exit__` or `finally` block, the less risk we have with SIGINT handling. The old `ui._write` code path has 8 Python instructions before reaching `release()`, `suspend.__exit__` has more. ``` Disassembly of ui._write, finally block: 844 130 LOAD_FAST 3 (suspended) 133 POP_JUMP_IF_FALSE 149 845 136 LOAD_GLOBAL 0 (progress) 139 LOAD_ATTR 11 (_suspendfinish) 142 CALL_FUNCTION 0 145 POP_TOP 146 JUMP_FORWARD 0 (to 149) >> 149 END_FINALLY Disassembly of progress._suspendfinish: 565 0 LOAD_GLOBAL 0 (_engine) 3 LOAD_ATTR 1 (_cond) 6 LOAD_ATTR 2 (release) 9 CALL_FUNCTION 0 12 POP_TOP 13 LOAD_CONST 0 (None) 16 RETURN_VALUE Disassembly of progress.suspend.__exit__: 576 0 LOAD_FAST 0 (self) 3 LOAD_ATTR 0 (_suspended) 6 POP_JUMP_IF_FALSE 19 577 9 LOAD_GLOBAL 1 (_suspendfinish) 12 CALL_FUNCTION 0 15 POP_TOP 16 JUMP_FORWARD 0 (to 19) >> 19 LOAD_CONST 0 (None) 22 RETURN_VALUE ``` This diff changes it so `__exit__` is backed directly by the `Condition` implementation, minimizing the Python instructions. In case `Condition` is backed by the native Rust implementation, it is atomic and cannot be interrupted by Python exceptions. `util.nullcontextmanager` is rewritten to be more efficient. Reviewed By: markbt Differential Revision: D10843398 fbshipit-source-id: ba5f5d47b5b9948324a228778e3362531da87107 |
||
---|---|---|
contrib | ||
distutils_rust | ||
doc | ||
exec | ||
hgdemandimport | ||
hgext | ||
hgext3rd | ||
i18n | ||
lib | ||
mercurial | ||
newdoc | ||
slides | ||
tests | ||
.editorconfig | ||
.flake8 | ||
.gitignore | ||
.hgsigs | ||
.jshintrc | ||
.watchmanconfig | ||
CONTRIBUTING | ||
CONTRIBUTORS | ||
COPYING | ||
gen_version.py | ||
hg | ||
hgeditor | ||
hgweb.cgi | ||
Makefile | ||
README.rst | ||
setup.py |
Mercurial ========= Mercurial is a fast, easy to use, distributed revision control tool for software developers. Basic install:: $ make # see install targets $ make install # do a system-wide install $ hg debuginstall # sanity-check setup $ hg # see help Running without installing:: $ make local # build for inplace usage $ ./hg --version # should show the latest version See https://mercurial-scm.org/ for detailed installation instructions, platform-specific notes, and Mercurial user information.