Commit Graph

14 Commits

Author SHA1 Message Date
Augie Fackler
6930c232d6 diffhelpers: fix botched return statement from e48d70075d8a
Spotted by Sean Farley using clang.
2015-01-28 13:34:20 -05:00
Augie Fackler
edda77a3dd diffhelpers: verify hline was created before using it
Found with cpychecker.
2015-01-27 10:07:04 -05:00
Adrian Buehlmann
65a9a97e69 diffhelpers: use Py_ssize_t in testhunk()
Eliminates

  mercurial/diffhelpers.c(143) : warning C4244: '=' : conversion from
  'Py_ssize_t' to 'int', possible loss of data
  mercurial/diffhelpers.c(144) : warning C4244: '=' : conversion from
  'Py_ssize_t' to 'int', possible loss of data

when compiling for Windows x64 target using the Microsoft compiler.
2012-05-12 14:00:51 +02:00
Adrian Buehlmann
0a73f19992 diffhelpers: use Py_ssize_t in addlines()
Eliminates

  mercurial/diffhelpers.c(81) : warning C4244: '=' : conversion from
  'Py_ssize_t' to 'int', possible loss of data
  mercurial/diffhelpers.c(82) : warning C4244: '=' : conversion from
  'Py_ssize_t' to 'int', possible loss of data

when compiling for Windows x64 target using the Microsoft compiler.
2012-05-12 13:21:08 +02:00
Adrian Buehlmann
930b763535 diffhelpers: use Py_ssize_t in _fix_newline()
Eliminates

  mercurial/diffhelpers.c(23) : warning C4244: 'initializing' : conversion from
  'Py_ssize_t' to 'int', possible loss of data
  mercurial/diffhelpers.c(26) : warning C4244: 'initializing' : conversion from
  'Py_ssize_t' to 'int', possible loss of data
  mercurial/diffhelpers.c(27) : warning C4244: 'initializing' : conversion from
  'Py_ssize_t' to 'int', possible loss of data
  mercurial/diffhelpers.c(30) : warning C4244: 'initializing' : conversion from
  'Py_ssize_t' to 'int', possible loss of data

when compiling for Windows x64 target using the Microsoft compiler.
2012-05-12 12:07:18 +02:00
Matt Mackall
360a8e9fb8 diffhelpers: harden testhunk 2012-05-12 10:02:47 +02:00
Martin Geisler
a76e121863 backout of e4cb9628354c
Matt and a majority of crew did not like this approach.
2011-01-27 11:15:08 +01:00
Martin Geisler
d23e1973c2 specify C indention style using Emacs file local variables 2011-01-26 12:05:01 +01:00
Renato Cunha
5ee0b47edb diffhelpers.c: Added support for py3k.
This patch adds support for py3k in diffhelpers.c. This is accomplished by
including a header file responsible for abstracting the API differences between
python 2 and python 3.
2010-06-15 19:49:56 -03:00
Matt Mackall
8d99be19f0 many, many trivial check-code fixups 2010-01-25 00:05:27 -06:00
Patrick Mezard
28bba5c92b diffhelpers: fix variable declaration for MSVC (not C99) 2009-12-28 18:29:35 +01:00
Patrick Mezard
d360072399 diffhelpers: handle CRLF in hunk last line without EOL
Note that diff generation code always ends last lines without newline with a
LF, so this is a tolerance.
2009-12-23 19:31:48 +01:00
Hollis Blanchard
9d5f9ce7a0 Handle patches with misformatted empty lines
Insert a space on empty lines which are missing a control character.

Signed-off-by: Hollis Blanchard <hollisb@us.ibm.com>
---
I frequently receive emailed patches with empty lines represented as "\n\n",
where Mercurial expects them to be "\n \n". patch(1) applies these patches
without complaint, but qpush fails all hunks.
2007-11-01 17:15:50 -05: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