A Scalable, User-Friendly Source Control System.
Go to file
Jun Wu 65d9160c6f xdiff: vendor xdiff library from git
Summary:
Vendor git's xdiff library from git commit
d7c6c2369d7c6c2369ac21141b7c6cceaebc6414ec3da14ad using GPL2+ license.

There is another recent user report that hg diff generates suboptimal
result. It seems the fix to issue4074 isn't good enough. I crafted some
other interesting cases, and hg diff barely has any advantage compared with
gnu diffutils or git diff.

| testcase | gnu diffutils |      hg diff |   git diff |
|          |    lines time |   lines time | lines time |
| patience |        6 0.00 |     602 0.08 |     6 0.00 |
|   random |    91772 0.90 |  109462 0.70 | 91772 0.24 |
|     json |        2 0.03 | 1264814 1.81 |     2 0.29 |

"lines" means the size of the output, i.e. the count of "+/-" lines. "time"
means seconds needed to do the calculation. Both are the smaller the better.
"hg diff" counts Python startup overhead.

Git and GNU diffutils generate optimal results. For the "json" case, git can
have an optimization that does a scan for common prefix and suffix first,
and match them if the length is greater than half of the text. See
https://neil.fraser.name/news/2006/03/12/. That would make git the fastest
for all above cases.

About testcases:

patience:
Aiming for the weakness of the greedy "patience diff" algorithm.  Using
git's patience diff option would also get suboptimal result. Generated using
the Python script:

```
open('a', 'w').write('\n'.join(list('a' + 'x' * 300 + 'u' + 'x' * 700 + 'a\n')))
open('b', 'w').write('\n'.join(list('b' + 'x' * 700 + 'u' + 'x' * 300 + 'b\n')))
```

random:
Generated using the script in `test-issue4074.t`. It practically makes the
algorithm suffer. Impressively, git wins in both performance and diff
quality.

json:
The recent user reported case. It's a single line movement near the end of a
very large (800K lines) JSON file.

Reviewed By: ryanmce

Differential Revision: D7124455

fbshipit-source-id: 832651115da770f9d2ed5fdff2e200453c0013f8
2018-04-13 21:51:20 -07:00
.cargo build: vendor in Rust dependencies 2018-01-09 17:48:32 -08:00
contrib xdiff: vendor xdiff library from git 2018-04-13 21:51:20 -07:00
distutils_rust windows: fix build_nupkg.py to work in a new setup 2018-04-13 21:50:54 -07:00
doc flake8: enable F821 check 2018-04-13 21:51:09 -07:00
hgdemandimport extensions: forbid "foo=" from importing foreign mercurial modules 2018-01-09 17:06:09 -08:00
hgext Make rebuilddirstate not crash due to existing corrupt dirstate files. 2018-04-13 21:51:20 -07:00
hgext3rd extensions: also search for extension in the 'hgext3rd' package 2016-03-11 10:30:08 +00:00
hgsubversion flake8: resolve some F checks 2018-04-13 21:51:09 -07:00
i18n flake8: enable some E checks 2018-04-13 21:51:09 -07:00
lib xdiff: vendor xdiff library from git 2018-04-13 21:51:20 -07:00
lz4revlog lz4revlog: internalize extension and test 2018-01-03 07:15:33 -08:00
mercurial hg: skip substate verification if verify.skipmanifests=True 2018-04-13 21:51:20 -07:00
tests tests: fix tests caused by tinit change 2018-04-13 21:51:20 -07:00
.clang-format clang-format: configuration for the clang-format source formatter 2015-01-24 17:04:25 -05:00
.editorconfig mercurial: add editorconfig 2016-04-05 18:10:33 +01:00
.flake8 flake8: enable some E checks 2018-04-13 21:51:09 -07:00
.gitignore tests: use an environment variable for getdb.sh location 2018-04-13 21:51:11 -07:00
.hg-vendored-crates build: vendor in Rust dependencies 2018-01-09 17:48:32 -08: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
.watchmanconfig watchman: add an empty .watchmanconfig 2018-04-13 21:50:54 -07: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
hg dispatch: move initialization of sys.std* files 2017-10-02 07:18:24 +01:00
hgeditor spelling: trivial spell checking 2015-10-17 00:58:46 +02:00
hgweb.cgi urls: bulk-change primary website URLs 2015-09-30 15:43:49 -05:00
Makefile remotefilelog: move to hgext/ 2018-01-08 18:58:08 -08:00
README.rst doc: rename README to README.rst 2017-09-26 08:37:17 +02:00
setup.py cleanup: remove more copy-and-pasted code 2018-04-13 21:51:15 -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.