Commit Graph

39 Commits

Author SHA1 Message Date
Vadim Gelfer
13d751feaf refactor text diff/patch code.
rename commands.dodiff to patch.diff.
rename commands.doexport to patch.export.
move some functions from commands to new mercurial.cmdutil module.
turn list of diff options into mdiff.diffopts class.

patch.diff and patch.export now has clean api for call from 3rd party
python code.
2006-08-12 16:13:27 -07:00
Vadim Gelfer
dc377b58c1 update copyrights. 2006-08-12 12:30:02 -07:00
Haakon Riiser
7b06333d1a diff: add -b/-B options 2006-06-29 15:16:25 +02:00
Vadim Gelfer
9a0c813fdc use demandload more. 2006-06-20 23:58:21 -07:00
Vadim Gelfer
1de5bf52df fix speed regression in mdiff caused by line split bugfix. 2006-05-10 13:39:12 -07:00
Vadim Gelfer
c440466a54 fix diffs containing embedded "\r".
add test to make sure fix stays fixed.
2006-05-10 10:31:54 -07:00
mason@suse.com
492b52fda3 Fill in the uncompressed size during revlog.addgroup
This uses code from Matt to calculate the size change that
would result from applying a delta to keep an accurate running
total of the text size during revlog.addgroup
2006-04-04 16:38:44 -04:00
Thomas Arendsen Hein
ba28644c7c Fix diff against an empty file (issue124) and add a test for this. 2006-02-15 14:22:16 +01:00
mason@suse.com
7bc44b52d9 Add new bdiff based unidiff generation. 2006-01-24 15:02:10 +13:00
twaldmann@thinkmo.de
584aa09dd6 minor optimization: save some string trash 2005-11-14 02:30:19 +02:00
Matt Mackall
e2ec207d22 Remove now unused sortdiff and diff from mdiff 2005-10-25 22:17:31 -07:00
Matt Mackall
c155ce9cdc Clean up mdiff imports 2005-10-04 11:25:48 -07:00
Benoit Boissinot
e36bbe72ee make diff dates be epoch for add/remove 2005-10-04 11:21:48 -07:00
mpm@selenic.com
af3be1f6a1 Add automatic binary file detection to diff and export
Based on a patch by Fuming Wang

- add util.binary which decides whether a file is binary if it has any NUL
  characters in the first 1K.
- teach mdiff.unidiff to print "binary file <x> has changed" for binary files
- add text flag to cause unidiff and dodiff to treat all files as text
- add -a and --text flags (like diff(1)) to hg diff and export
- update docs
2005-08-23 19:58:46 -07:00
mpm@selenic.com
4394004b4a Remove all remaining print statements
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

Remove all remaining print statements

Convert most prints to ui.warn or ui.write
Pass a write function into transactions

manifest hash: d1b0af7a344fc087a5acfe3ae87b782c20d043e0
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.0 (GNU/Linux)

iD8DBQFCx1Q3ywK+sNU5EO8RAqSTAJwM5t/m+JOlf2ZXOjuItCSdFiubcwCdFm3G
HoicikSYpTgfCj2pIRfyLjo=
=Loqo
-----END PGP SIGNATURE-----
2005-07-02 18:57:59 -08:00
mpm@selenic.com
0fb5db6915 Whitespace cleanups
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

Whitespace cleanups

manifest hash: ac954bc3a4f034c12638a259ecd65841f5b63c5c
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.0 (GNU/Linux)

iD8DBQFCwuubywK+sNU5EO8RAluIAJ98XQpNdZUpSmYKgDmrMRlbL76ZzQCfes0t
rknNUN/PhtyA4bzL646dOz4=
=UyCE
-----END PGP SIGNATURE-----
2005-06-29 10:42:35 -08:00
mpm@selenic.com
d2615cc70c Start using bdiff for generating deltas
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

Start using bdiff for generating deltas

manifest hash: bf6ed7d17d96810b7f40b50811b104b568c64b4b
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.0 (GNU/Linux)

iD8DBQFCubqVywK+sNU5EO8RAor6AKCm8Zqg0DIhLzaMPp5/GKPKk/GjKwCfbCe+
/CBmpvcTxSJofY9RE08cCVY=
=2yu2
-----END PGP SIGNATURE-----
2005-06-22 11:23:01 -08:00
Thomas Arendsen Hein
878eebd88e Show revisions in diffs like CVS, based on a patch from Goffredo Baroncelli.
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

Show revisions in diffs like CVS, based on a patch from Goffredo Baroncelli.
Changes from the original patch:
- - Use 'diff -r ...' instead of 'hg diff -r ...' to support filetype detection
  by at least file(1) and vim.
- - Adjusted tests for this change.
- - Some cleanups.

manifest hash: 5f37d1ef75ea7f4e48b53f02371053ba54fb70f8
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.1 (GNU/Linux)

iD8DBQFCsyZzW7P1GVgWeRoRAqczAJ479lR9Z289sP+VH5L+N7pQRU14SACfUueq
88ABloIR3VyRIa4qbujnZio=
=Vva9
-----END PGP SIGNATURE-----
2005-06-17 20:37:23 +01:00
mpm@selenic.com
923df46e46 Fix another sortdiff cornercase
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

Fix another sortdiff cornercase

manifest hash: 32b2d1750689c561c9471fb68a9f3571364399cb
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.0 (GNU/Linux)

iD8DBQFCsL6AywK+sNU5EO8RAhaeAJ4zw18vo4oGTvymplKb7olKEeg0aQCfVxX1
2o/PcrE6EeboHpQn5E0Wb/Y=
=eENW
-----END PGP SIGNATURE-----
2005-06-15 15:49:20 -08:00
mpm@selenic.com
b51d9e3229 mdiff: fix the fix
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

mdiff: fix the fix

I saw you check in the thing back in but with another typo.

You check in "la < lenb", should be "la < lena".

So we are even :-)

Chris


manifest hash: 57157502250b0120bcc12a75a530d4c133673b39
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.0 (GNU/Linux)

iD8DBQFCrg5tywK+sNU5EO8RAvLPAKCOs76LKPniKHFa15YwzWWsNZ5/xACfesl3
WCiUjdeYUtU3jVKCEwmjAT0=
=+GFy
-----END PGP SIGNATURE-----
2005-06-13 14:53:33 -08:00
mpm@selenic.com
6ecc8916bc mdiff: reinstate new algorithm
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

mdiff: reinstate new algorithm

This unreverts the new algorithm with a fix from Chris (s/len/lena)
and adds some comments on what it's doing.

manifest hash: 75fc1acee1926e57d495f67a44cd88d9555f2356
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.0 (GNU/Linux)

iD8DBQFCrf4UywK+sNU5EO8RAoRzAKCA2vpUAGNqTkDeba3YHo6XXht7VgCfXQK0
/j5yv5cucnsYezCdclpftOA=
=FNMD
-----END PGP SIGNATURE-----
2005-06-13 13:43:48 -08:00
mpm@selenic.com
8f62e88ec1 mdiff: revert grouping optimization for the time being
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

mdiff: revert grouping optimization for the time being

This had trouble with Ted T'so import test while the original didn't.

manifest hash: e2fc49b5277096bd4c5081558af5efe9964d5310
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.0 (GNU/Linux)

iD8DBQFCrHzXywK+sNU5EO8RArocAJwKlxrnyVpdYaKzgJG/b4gSVOYBTwCgkl2t
zD807fsMULRDdDe1k9jVPcU=
=Iivz
-----END PGP SIGNATURE-----
2005-06-12 10:20:07 -08:00
mpm@selenic.com
1b72add8c7 hg commit: user and date options
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

hg commit: user and date options

- From Ted Ts'o

manifest hash: f6ce29eed387664c6f0631b666158eb930876cb3
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.0 (GNU/Linux)

iD8DBQFCrHx4ywK+sNU5EO8RAp/uAKCEGhvm1tpBJ9Bub8BlalWaIpMeqgCfUejo
IoevMbk4cjxQ5P3Zo2pSFs8=
=Ibp3
-----END PGP SIGNATURE-----
2005-06-12 10:18:32 -08:00
mpm@selenic.com
551154e610 unidiff: handle empty diffs more gracefully
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

unidiff: handle empty diffs more gracefully

manifest hash: e2030f7e55dc333ba0cd5b0847d1f1a08e3c5d64
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.0 (GNU/Linux)

iD8DBQFCpz0uywK+sNU5EO8RAnt4AJ9pyaS6/xNnlhCUocq3m0HbCwHJ/gCgrP/H
IvBJtq1eXvRedfitF25vBgw=
=pd5n
-----END PGP SIGNATURE-----
2005-06-08 10:47:10 -08:00
mpm@selenic.com
6fe3792f6b diff: use tab to separate date from filename
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

diff: use tab to separate date from filename

manifest hash: 73812de990e0e787320c11f7bd83c4ca91a52c4c
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.0 (GNU/Linux)

iD8DBQFCpdDxywK+sNU5EO8RAhKwAKCFcUa/p6ALbjoOl4I8VKJknZtu7gCdFvoE
HQn1iq4gnJoeurB7YLMRpqc=
=ltYP
-----END PGP SIGNATURE-----
2005-06-07 08:53:05 -08:00
mpm@selenic.com
d7c489168a Attempt to make diff deal with null sources properly
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

Attempt to make diff deal with null sources properly

manifest hash: 7766ed2b885640157b93474b6e42573ec061fcfb
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.0 (GNU/Linux)

iD8DBQFCpJsdywK+sNU5EO8RAr5gAJ9sIik+3FDyI8UvIvrWlku4QgMZWQCcDFvh
MvtqY8pFYTFLp7tM2zzTlu4=
=a0oy
-----END PGP SIGNATURE-----
2005-06-06 10:51:09 -08:00
mpm@selenic.com
f95bf8d95c import and startup cleanups
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

import and startup cleanups

add commands:run()
add copyright notice to commands
eliminate/reorganize imports to speed up start time:

0.5b:
$ time bash -c 'for i in `seq 100`; do ~/bin/hg > /dev/null; done'

real    0m7.718s
user    0m6.719s
sys     0m0.794s

new:

$ time bash -c 'for i in `seq 100`; do hg > /dev/null; done'
real    0m2.171s
user    0m1.684s
sys     0m0.444s

just python:

$ time bash -c 'for i in `seq 100`; do python -c pass; done'
real    0m0.988s
user    0m0.771s
sys     0m0.207s

Ignoring the fixed cost of loading the Python interpreter, we're 5.6
times faster. With the Python load time, we're still 3.5 times faster.

manifest hash: acce5882a55c76eb165316f5741724c8ce4ef587
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.0 (GNU/Linux)

iD8DBQFCoihAywK+sNU5EO8RAqMdAJwMe6Ur0R9G6jjayNa5hH2C3c4k/gCeIYvc
N178vaWWGciX9zq+g5qCAls=
=buhv
-----END PGP SIGNATURE-----
2005-06-04 14:16:32 -08:00
mpm@selenic.com
9fec0c0d80 mdiff.py: kill #! line, add copyright notice
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

mdiff.py: kill #! line, add copyright notice

manifest hash: acb4e14d5947d0fde5b89a874af0476773ee1cee
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.0 (GNU/Linux)

iD8DBQFCoM9CywK+sNU5EO8RAizVAJ41dqQxxx8nouBxJMcFmoVRRo4GfACbB9RV
Xc0cqaoPVL7p87opPKjgNWw=
=HyjH
-----END PGP SIGNATURE-----
2005-06-03 13:44:34 -08:00
mpm@selenic.com
b43cebfe40 Improved binary diff from Christopher Li
This is more intelligent/efficient by combining neighboring inserts,
replaces and deletes. Passes test of converting kernel repo, but
doesn't appear to substantially affect compression or performance.
2005-05-27 19:38:34 -08:00
mpm@selenic.com
59375bb06a hg diff: fix missing final newline bug 2005-05-26 13:02:28 -08:00
mpm@selenic.com
a264d87bbd Fix braindamaged import in mdiff. 2005-05-20 19:19:25 -08:00
mpm@selenic.com
36152aee36 Remove python version of the patches code 2005-05-20 17:49:25 -08:00
mpm@selenic.com
4e35c669ab Add a function to return the new text from a binary diff 2005-05-20 17:42:29 -08:00
mpm@selenic.com
8dcd538ef7 Fix a bug in patches() if there's not text and no patch 2005-05-17 00:32:18 -08:00
mpm@selenic.com
f161c8bdc8 Add an O(m + nlog n) patching extension 2005-05-16 22:08:33 -08:00
mpm@selenic.com
e56388d1b4 Add mdiff.patches to speed up applying thousands of patches to the manifest 2005-05-14 10:27:14 -08:00
mpm@selenic.com
264f689db9 Diff in subdirectories from Jake Edge
Dates in diff
Fix O(n^2) behaviour of manifest diff
Add a/ and b/ to work with patch -p1
2005-05-12 17:54:55 -08:00
mpm@selenic.com
e10ce18d5b unidiff: punt on comparing empty files 2005-05-07 16:10:50 -08:00
mpm@selenic.com
ca8cb8ba67 Add back links from file revisions to changeset revisions
Add simple transaction support
Add hg verify
Improve caching in revlog
Fix a bunch of bugs
Self-hosting now that the metadata is close to finalized
2005-05-03 13:16:10 -08:00