Commit Graph

105 Commits

Author SHA1 Message Date
Patrick Mezard
a802f4255a patch: be more tolerant to diffstat failures (issue 865)
Sometimes, revisions cannot be represented by a regular diff, only a git diff
would capture binary files or permission changes. diffstat cannot handle git
patches and will output "0 files changed" when fed with an empty diff. We
cannot consider the latter to be an error, unless we rewrite diffstat to handle
these correctly.
2007-12-25 22:21:51 +01:00
Patrick Mezard
4bd17cf5de mq: missing target files do not make qpush to fail immediately (issue 835)
Reported and explained by Peter Arrenbrecht <peter.arrenbrecht@gmail.com>.
Following file additions were skipped but empty files were still created. This situation could lead to qrefresh losing patch information.
2007-12-02 13:53:29 +01:00
Jim Hague
5ef18ea71f patch: fix sort() comparator argument
'hg import' fails under Python 2.3. The name of the compare function parameter in the call to list.sort() is 'cmpfunc' in Python 2.3 and
'cmp' in Python 2.4+. Passing the compare function as a named parameter is therefore problematic.
2007-11-25 11:49:34 +01:00
Dustin Sallings
bebcdac954 Use both the from and to name in mdiff.unidiff.
This fixes a compatibility issue with git diffs.
* * *
2007-11-01 12:17:59 -07:00
Patrick Mezard
6aa1e21320 Fix Windows os.popen bug with interleaved stdout/stderr output
See python bug 1366 "popen spawned process may not write to stdout under windows" for more details.
2007-11-01 12:05:14 +01:00
Thomas Arendsen Hein
d3c1b2079e Only set mode of new patch if the target file was removed before.
If the file is writable by the user, but owned by a different user, the
chmod will otherwise fail with "Operation not permitted".

Additionally make very sure that the file is only written if either the number
of links is <= 1 or the file was successfully removed.

Maybe this minimal COW code should be replaced by something from util.
2007-10-25 19:40:56 +02:00
Patrick Mezard
59a5193f63 patch: fix git sendmail handling without proper mail headers 2007-10-08 22:20:23 +02:00
Alexis S. L. Carvalho
fa0374301e Always copy the necessary files before applying a git patch
This patch removes the "copymod" attribute from the gitpatch
class.

AFAICS, that attribute was only used to delay the copying of
renamed/copied files if there are no other changes to the target,
but in this case, if there are changes to the source, we'll end
up copying the wrong version.

This should fix issue762.
2007-10-06 15:30:15 -03:00
Alexis S. L. Carvalho
de9e404b5c Avoid a working dir walk while trying to detect copies for diff --git 2007-08-28 23:02:41 -03:00
Alexis S. L. Carvalho
a718b1f9b5 Make hg diff --git -r revA:revB detect (inverted) copies if revA > revB 2007-08-28 22:48:25 -03:00
Thomas Arendsen Hein
e34927453f Remove trailing spaces, fix indentation 2007-08-07 10:28:43 +02:00
Brendan Cully
7bd6f8b503 patch: add git symlink support 2007-08-04 23:07:52 -07:00
Bryan O'Sullivan
ce7f264f24 patch: make internal code a bit friendlier to use 2007-07-31 16:28:05 -07:00
Bryan O'Sullivan
46b7a3a9ca patch: remove unused parameter from b85diff 2007-07-30 20:49:08 -07:00
Matt Mackall
cd72dc7f1b Merge with crew 2007-07-21 16:44:38 -05:00
Matt Mackall
3a3bd8ec5b Make repo locks recursive, eliminate all passing of lock/wlock 2007-07-21 16:02:10 -05:00
Patrick Mezard
dd336a8d1a patch: patches should be read and written in binary mode when possible. 2007-07-17 23:35:24 +02:00
Patrick Mezard
ccc14e4990 patch: fix normalized paths separators. 2007-07-17 23:34:52 +02:00
Bryan O'Sullivan
6c741e45c0 patch.py: re-add the ability to use an external patch program
This is now invoked by default only if ui.patch is set.  Otherwise, we
use our built-in patch.  If that fails because it can't find any valid
hunks, we'll fall back to trying the external patch command.
2007-07-17 09:39:30 -07:00
Bryan O'Sullivan
78c5b7bde0 patch.py: don't mark files as changed unless they have actually been changed 2007-07-17 09:39:30 -07:00
Bryan O'Sullivan
691d74d7d4 patch.py: fix some incorrect uses of _() for i18n 2007-07-17 09:39:30 -07:00
Bryan O'Sullivan
590b9213d3 Add Chris Mason's mpatch library.
The original repo is http://oss.oracle.com/mercurial/mason/mpatch
2007-07-17 09:39:30 -07:00
Brendan Cully
e8ad904a56 patch.extract: fix test-import breakage introduced in the previous changeset 2007-07-02 13:26:12 -07:00
Brendan Cully
099f763bc1 patch.extract: do not prepend subject if the description already starts with it 2007-07-02 10:59:16 -07:00
Thomas Arendsen Hein
3019bb7a0b Kill trailing spaces 2007-06-21 09:25:49 +02:00
Patrick Mezard
8f4c2f4b77 patch: fix ui.patch regression introduced by ef94caf261ce.
The idea is ui.patch is either empty or wisely filled by user.
2007-06-19 17:02:07 +02:00
Thomas Arendsen Hein
49220695bc Removed trailing whitespace and tabs from python files 2007-06-06 20:22:52 +02:00
Alexis S. L. Carvalho
976e7af22b patch.diff: avoid calling workingctx().manifest()
Right now, to generate the manifest of the working dir, we have to
perform a full walk of the working dir, which will be very slow,
especially if we're interested in only a small part of it.

Since we use the manifest only to find out the mode of files for git
patches, manually build an execf function to do it.

This should fix issue567.
2007-06-03 14:38:52 -03:00
Bryan O'Sullivan
4eff752451 Automated merge with http://hg.intevation.org/mercurial/crew 2007-05-27 14:43:29 -07:00
Bryan O'Sullivan
d67a234671 Introduce find_exe. Use instead of find_in_path for programs.
The behaviour of find_in_path was broken for config options containing
path names, because it always searched the given path, even when not
necessary.  The find_exe function is more polite: if the name passed
to it contains a path component, it just returns it.
2007-05-27 14:26:54 -07:00
Eric Hopper
9da473c4e8 Add ability to parse branch information to hg import 2007-05-17 20:09:47 -07:00
Eric Hopper
119a887cdc Add branch information to hg export. 2007-05-10 13:42:36 -07:00
Patrick Mezard
3e2c29954d Add ui.patch option.
ui.patch overrides the default patch/gpatch command and options.
2007-05-12 21:09:31 +02:00
Patrick Mezard
37afbaec09 Fix issue483 - mq does not work under windows with gnu-win32 patch.
Add --binary option to patch command under win32.
2007-05-12 21:09:29 +02:00
Alexis S. L. Carvalho
047c4b002b Merge with crew-stable. 2007-04-07 04:45:27 -03:00
Alexis S. L. Carvalho
0489c59b5e Try to find diffstat in PATH before calling it
At least on Solaris, /bin/sh will print a "command not found" message
even if we redirect stderr.
2007-04-07 04:27:55 -03:00
Alexis S. L. Carvalho
fcb39243b1 pass repo.root to util.pathto() in preparation for the next patch 2007-03-16 00:22:57 -03:00
Brendan Cully
00246f4c76 Add import --exact.
When this option is set, import will apply the patch (which must
be generated by export) to the parents specified in the patch,
and check that the node produced by the patch matches the node
ID in the patch.
2007-03-22 10:44:59 -07:00
Alexis S. L. Carvalho
47cb22b5a2 Merge with crew-stable 2007-03-16 00:45:18 -03:00
Brendan Cully
1c21b0ba74 git-send-email compatibility: stop reading changelog after ^---$ 2007-03-14 11:46:07 -07:00
Brendan Cully
6b751ffa32 Make [PATCH] removal slightly more robust 2007-03-13 21:54:34 -07:00
Brendan Cully
cdd51812ef Strip [PATCH...] from message subject when importing patches 2007-03-12 13:58:06 -07:00
Alexis S. L. Carvalho
641d95a966 Merge a bunch of matcher and locate fixes. 2007-03-10 23:21:33 -03:00
Alexis S. L. Carvalho
1ac4016af4 remove obsolete code from patch.diff
repo.status already does this filtering.  If the caller supplies a set of
changes, it's his responsibility to filter out what he doesn't want.
2007-03-10 23:00:43 -03:00
Alexis S. L. Carvalho
8cab83c8ec git binary patches: don't print the header for identical files 2007-02-17 09:55:00 -02:00
Alexis S. L. Carvalho
fe408bb673 git binary patches: use hashes to detect identical files 2007-02-17 09:54:59 -02:00
Alexis S. L. Carvalho
14c4429263 git patches: handle renames of binary files 2007-02-16 04:54:46 -02:00
Brendan Cully
d71b00e6f3 Suppress <stdout> before hg export -v (regression from previous patch). 2007-03-02 14:03:30 -08:00
Brendan Cully
507ce565c1 Let patch.export handle any fp-like object 2007-03-01 20:53:38 -08:00
Thomas Arendsen Hein
134efad44c merge with crew-stable 2007-02-20 20:55:23 +01:00