mirror of
https://github.com/facebook/sapling.git
synced 2024-10-12 01:39:21 +03:00
A Scalable, User-Friendly Source Control System.
771fa19f18
Summary: The current `dott` library enforces `sh % "foo"` to output nothing. That's done by checking in `__del__`. `__del__` is special and cannot raise exceptions so the current code put exceptions in a "delayed" list and raise it later. However, the "later" raise uses a new traceback that is useless. This diff changes it to use `sys.exc_info` to save the traceback information so we can re-raise with more accurate exception: For example, the exception before looks like: % python test-empty-t.py Traceback (most recent call last): File "test-empty-t.py", line 71, in <module> sh % "cd .." File "fbcode/scm/hg/tests/testutil/dott/shobj.py", line 151, in __mod__ return LazyCommand(command) File "fbcode/scm/hg/tests/testutil/dott/shobj.py", line 28, in __init__ raise _delayedexception[0] UnboundLocalError: local variable 'code' referenced before assignment The `shobj.py` in traceback is pointless. With the change, it now looks like: % python test-empty-t.py Traceback (most recent call last): File "test-empty-t.py", line 71, in <module> sh % "cd .." File "fbcode/scm/hg/tests/testutil/dott/shobj.py", line 153, in __mod__ return LazyCommand(command) File "fbcode/scm/hg/tests/testutil/dott/shobj.py", line 97, in __del__ autofix.eq(out, "", nested=1, fixfunc=_fixoutput) File "fbcode/scm/hg/tests/testutil/autofix.py", line 74, in eq fix = fixfunc(code, parse, lineno, parse(path)) UnboundLocalError: local variable 'code' referenced before assignment Reviewed By: xavierd Differential Revision: D17277288 fbshipit-source-id: 91f22b75b2e2efd632f5844b1d2554e7406be926 |
||
---|---|---|
contrib | ||
distutils_rust | ||
doc | ||
edenscm | ||
edenscmnative | ||
exec | ||
i18n | ||
lib | ||
newdoc | ||
slides | ||
tests | ||
.editorconfig | ||
.flake8 | ||
.gitignore | ||
.hgsigs | ||
.jshintrc | ||
CONTRIBUTING | ||
CONTRIBUTORS | ||
COPYING | ||
gen_version.py | ||
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.