Mads Kiilerich
865bdae0fa
patch: strip paths in leaked git patchmeta objects
2010-04-26 13:21:03 +02:00
Mads Kiilerich
345145e804
patch: minor cleanup of _applydiff
2010-04-26 13:21:03 +02:00
Mads Kiilerich
63938a51f6
patch: git delete mode shouldn't be used at all
2010-04-26 13:21:02 +02:00
Mads Kiilerich
9f2ca1164a
patch: make "unable to strip away" message less confusing
2010-04-26 13:21:02 +02:00
Mads Kiilerich
10fedd8d3d
patch: descriptive patchmeta.__repr__ to help debugging
2010-04-26 13:21:02 +02:00
Augie Fackler
2556500e58
patch: refactor applydiff to allow for mempatching
2010-04-17 13:23:24 -05:00
Augie Fackler
4da02e74e7
patch: move mercurial-specific imports after stdlib imports
2010-04-17 13:13:57 -05:00
Nicolas Dumazet
7f1a963829
pylint, pyflakes: remove unused or duplicate imports
2010-04-14 17:58:10 +09:00
Brendan Cully
76b7a3a26b
Merge with stable
2010-04-11 20:59:55 -07:00
Peter Arrenbrecht
7abe6f6609
patch: don't look for headers in diff lines
...
If you have a diff line that matches a header line, the patch splitter
currently breaks your patch at this line. For example a line like:
+key: value
This can lead to "malformed patch" exceptions. Now fixed.
2010-04-09 20:34:05 +02:00
Brodie Rao
e504a56477
diff: make use of output labeling
2010-04-02 15:22:06 -05:00
Benoit Boissinot
6173388ed6
patch: warn when the internal patcher fails
...
hopefully we'll soon fix the remaining failures from the internal patcher, and
not use the external one anymore.
2010-03-22 11:08:42 +01:00
Matt Mackall
092c3572fb
Merge with stable
2010-03-20 16:57:24 -05:00
Matt Mackall
453a04eaaf
Merge with stable
2010-03-20 10:01:56 -05:00
Benoit Boissinot
879a4a71db
patch: more precise NoHunk, raised for every file (issue2102)
2010-03-20 14:47:05 +01:00
Benoit Boissinot
6ed4471107
patch: differentiate start of file with diff --git vs '--- '
2010-03-20 21:16:22 +01:00
Benoit Boissinot
f5bfcde5cb
patch: try harder to find the file to patch on file creation (issue2041)
...
accept the following patch header:
first line: foo/a.orig
second line: foo/a
2010-03-19 22:52:38 +01:00
Matt Mackall
ef87d8630d
Merge with stable
2010-03-19 16:05:16 -05:00
Benoit Boissinot
223c085b2b
patch: second line of a context diff starts with '--- ', not '+++ '
2010-03-19 12:45:39 +01:00
Benoit Boissinot
0ad95ca3aa
patch: enhance diff detection regexp, allow '--- ' in patch message
2010-03-18 18:22:34 +01:00
Brendan Cully
791f92f6bd
Merge with stable
2010-03-18 14:36:24 -07:00
Benoit Boissinot
5af4a60795
patch/diff: move diff related code next to each other
2010-03-09 19:04:18 +01:00
Benoit Boissinot
04d99f9fbc
patch/diff: move patch.export() to cmdutil.export()
...
This API change will allow us to break a cycle between patch and cmdutil.
2010-03-08 19:43:24 +01:00
Patrick Mezard
dede247fea
patch: fix patching with fuzz and eol normalization
2010-02-22 22:55:58 +01:00
Wagner Bruna
9b81c3ec4d
patch, i18n: avoid parameterized messages
...
Singular message removed for simplicity.
2010-02-19 13:04:11 -02:00
Brendan Cully
de7c8ccdfb
import: if in doubt, consume stream until start of diff
...
This prevents a header-like line in the message body from causing a spurious split.
2010-02-18 10:46:01 -08:00
Patrick Mezard
908955c63c
patch: remove useless copy, cleanup
2010-02-14 17:53:23 +01:00
Wagner Bruna
ce83d27cac
patch: separate reverse copy data (issue1959)
2010-02-11 11:22:57 -02:00
Brendan Cully
ce047e9ab3
import: import each patch in a file or stream as a separate change
...
Supports hg export <revrange>, mail messages, and mailboxes.
Does not support multiple patches in a single MIME attachment.
Closes issue167.
2010-02-07 18:06:52 +01:00
Matt Mackall
8d99be19f0
many, many trivial check-code fixups
2010-01-25 00:05:27 -06:00
Matt Mackall
cd3ef170f7
Merge with stable
2010-01-19 22:45:09 -06:00
Matt Mackall
595d66f424
Update license to GPLv2+
2010-01-19 22:20:08 -06:00
Patrick Mezard
c6da65973e
patch: explicitely close input patch files when leaving
...
If applydiff() raises an exception, the opened patch file is kept alive in the
exception context. If it is a temporary file (for instance supplied by import
command with stdin input), Windows cannot clean it up.
2010-01-03 19:47:07 +01:00
Greg Onufer
5056bcbd9e
patch: better handling of sequence of offset patch hunks (issue1941)
...
The built-in patch implementation applied the hunks to the wrong lines of the
file if the file in the repo has been modified to skew the patch line numbers
and the file contains repetitive sequences of lines.
2009-12-09 16:56:00 -08:00
Yannick Gingras
ed1d8b7e7a
diff: add --inverse option
...
Most of the time, one can reverse a diff by swapping the revisions passed with
-r but it happens that if you use the global -R, and diff against the tip of
the current repo, you can't swap the revisions. One use-case for that is
reviewing changes from a bundle before unbundling. One could also pipe the
output of `hg diff` to a command line filter that reverses the diff, but that
would remove the benefit from color diffs. Therefore, having an option in
`hg diff` to reverse a diff is a good thing.
The option flag selection was tricky. GNU patch uses -R/--reverse but -R is
already used as a global option and --reverse would make --rev ambiguous.
2009-11-05 15:18:56 +01:00
Dirkjan Ochtman
12c5890a70
kill trailing whitespace
2009-11-05 10:44:36 +01:00
Benoit Boissinot
01d3fbbbd0
patch: use the public ctx API instead of the internals
2009-10-31 18:02:34 +01:00
Benoit Boissinot
9015e8911f
patch: don't use mutable object as default argument
2009-10-31 18:02:13 +01:00
Benoit Boissinot
1c058dc6e9
patch: initialize all attributes of the hunk class
2009-10-31 18:01:08 +01:00
Benoit Boissinot
667b87aaec
patch: simplify logic
2009-10-31 18:00:05 +01:00
Brodie Rao
7c2f2247c5
diffstat: with --git, mark binary files with Bin
...
Normally, diffs without any text insertions or deletions are reported
as having 0 lines changed by stock diffstat. Compatibility is
preserved with stock diffstat in this case, but when using --git,
binary files are marked with Bin as a means of clarification.
git diff --stat does something similar, though it also includes the
old and new file sizes.
2009-10-25 02:53:33 +02:00
Brodie Rao
cd4a91c73f
diffstat: print 0 instead of nothing for 0 adds or removes
...
This is in line with how the stock diffstat behaves when processing a
single diff with no line modifications (like a binary diff).
2009-10-25 02:35:35 +02:00
Patrick Mezard
990e7895a0
Merge with crew-stable
2009-10-16 00:06:23 +02:00
Patrick Mezard
7b9a712086
patch: handle symlink updates/replacements (issue1785)
2009-10-15 23:15:30 +02:00
Patrick Mezard
5c89cb752a
patch: handle symlinks without symlinkhunk
...
Symlink creations and deletions were handled with a special symlinkhunk object,
working like a binary hunk. However, this model does not support symlink
updates or replacements, so we teach regular hunks how to handle symlinks.
2009-10-15 23:15:30 +02:00
Patrick Mezard
a7d029beb4
patch: do not swallow header-like patch first line (issue1859)
...
Current solution is hackish but looks like a good trade-off short of rewriting
patch.extract() significantly.
2009-10-08 23:42:33 +02:00
Matt Mackall
b6547e5312
Merge with stable
2009-10-11 13:54:19 -05:00
Martin Geisler
9f1896c083
do not attempt to translate ui.debug output
2009-09-19 01:15:38 +02:00
Nicolas Dumazet
908bc54270
patch: remove the unused, broken reverse() function
2009-08-23 14:32:58 +02:00
Nicolas Dumazet
1291ef7c74
patch: readgitpatch: remove unused variable 'src'
2009-08-24 14:40:21 +02:00