Commit Graph

281 Commits

Author SHA1 Message Date
Martin Geisler
e9c2a20771 diff: recurse into subrepositories with --subrepos/-S flag 2010-09-03 12:58:51 +02:00
Martin Geisler
c27c54faec clone, patch, convert: use hex(nullid) instead of '0'*40 2010-09-02 12:08:13 +02:00
Martin Geisler
cb36142754 Merge with stable 2010-08-29 22:55:37 +02:00
Martin Geisler
5f46f16fb7 Lowercase error messages 2010-08-29 22:37:58 +02:00
Martin Geisler
bfea979db3 util: remove lexists, Python 2.4 introduced os.path.lexists 2010-08-25 16:23:32 +02:00
Martin Geisler
d396293ec7 patch: fix typo in comment 2010-08-12 17:58:03 +02:00
Dan Drake
32aaa61ef2 patch: fix extract() docstring, it returns branch as well 2010-07-22 14:30:27 +09:00
FUJIWARA Katsunori
2f9dbb12f7 i18n: use encoding.colwidth() for correct column width
Some encoding and language combinations (e.g.: UTF-8 and Japanese)
cause encoding characters into sequence of bytes more than column
width of them.

So, encoding.colwidth() should be applied instread of len() on i18n
strings.

In addition to it, formatting by '%*s'/'%-*s' also uses "number of
bytes" to calculate space padding size, and should be fixed, too.
2010-07-18 01:06:50 +09:00
Dirkjan Ochtman
56aef99b57 patch: inline small, single-use 'write' function 2010-06-17 15:51:27 +02:00
Dirkjan Ochtman
12058a3e8e patch: inline small, single-use 'close' function 2010-06-17 15:50:35 +02:00
Dirkjan Ochtman
af6b696f0f move working dir/dirstate methods from localrepo to workingctx 2010-06-07 20:03:32 +02:00
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