A Scalable, User-Friendly Source Control System.
Go to file
Jun Wu 771fa19f18 testutil/dott: raise exceptions with better tracebacks
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
2019-09-10 13:01:32 -07:00
contrib update chg to correctly honor the pager.stderr setting 2019-09-09 11:48:42 -07:00
distutils_rust distutils_rust: workaround a 'cc' deadlock issue 2019-09-10 10:49:52 -07:00
doc doc: remove unused doc build step 2019-05-14 15:09:42 -07:00
edenscm bindings: remove RepackablePyExt 2019-09-10 11:36:00 -07:00
edenscmnative setup: move native extensions to edenscmnative 2019-06-19 17:55:49 -07:00
exec tp2/rust-crates-io: Update structopt to remove no_version 2019-09-06 13:46:06 -07:00
i18n ui: add labelled prefixes to ui.write 2019-05-09 06:55:11 -07:00
lib revisionstore: simplify Repackable trait 2019-09-10 11:36:01 -07:00
newdoc doc: update WritingNativeCommands 2019-08-28 19:26:28 -07:00
slides slides: recompile with newer tex toolchain 2019-04-18 13:50:03 -07:00
tests testutil/dott: raise exceptions with better tracebacks 2019-09-10 13:01:32 -07:00
.editorconfig move scm/hg/.clang-format to scm/hg/mercurial/ 2018-05-25 14:35:51 -07:00
.flake8 codemod: join the auto-formatter party 2018-05-25 22:17:29 -07:00
.gitignore setup: move native extensions to edenscmnative 2019-06-19 17:55:49 -07:00
.hgsigs Added signature for changeset f51ae48a3fd9 2017-12-01 13:49:47 -06:00
.jshintrc hgweb: add .jshintrc with some basic rules 2017-11-22 22:18:06 +08:00
CONTRIBUTING contributing: add new file with a pointer to the wiki 2016-10-08 10:39:00 -04:00
CONTRIBUTORS Add note to CONTRIBUTORS file 2007-11-07 21:10:30 -06:00
COPYING COPYING: refresh with current address from fsf.org 2011-06-02 11:17:02 -05:00
gen_version.py generate __version__.py during the buck build 2018-06-25 15:52:25 -07:00
hgeditor spelling: trivial spell checking 2015-10-17 00:58:46 +02:00
hgweb.cgi codemod: import from the edenscm package 2019-01-29 17:25:32 -08:00
Makefile makefile: remove 'hg version' invocation in make local 2019-08-28 13:54:57 -07:00
README.rst doc: rename README to README.rst 2017-09-26 08:37:17 +02:00
setup.py lib: remove cargo workspace 2019-08-26 17:34:34 -07:00

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.