[svn.haxx.se] · SVN Dev · SVN Users · SVN Org · TSVN Dev · TSVN Users · Subclipse Dev · Subclipse Users · this month's index

[PATCH] v5. Fix issue 3459.

From: Daniel Näslund <daniel_at_longitudo.com>
Date: Sun, 6 Sep 2009 21:48:03 +0200

Hi!

Julian had some concerns about the design of the line_transformer
callback for svn_stream_readline() in r38973. Perhaps other will vote in
favor of keeping the current implementation. If so, then this patch
fixes issue 3459 using the line_transformer.

The new cmdline test is a copy-and-paste thing. It does not check for
trailing or beginning empty lines of a hunk.

make check passed.

[[[
Fix issue 3459: svn patch does not tolerate empty lines of context in
unidiff.

As a side effect, libsvn_client is shielded from the notion of leading
diff symbols on lines.

* subversion/libsvn_diff/parse_diff.c
  (remove_leading_char_filter): New. Line-transformer callback that
    shaves leading diff symbols.
  (svn_diff__parse_next_hunk): Change logic for checking if line is in
    hunk. Set line-transformer callback on all three created streams.

* subversion/tests/libsvn_diff/parse-diff-test.c
  (test_parse_unidiff): Change assertions to compare lines without
    leading diff symbols.

* subversion/tests/cmdline/patch_tests.py
  (patch_chopped_leading_spaces): New. Same as patch_unidiff() but with
    leading empty spaces removed on empty lines.
  (test_list): Add patch_chopped_leading_spaces().

* subversion/libsvn_client/patch.c
  (match_hunk): Compare whole lines since there is no leading diff
    symbols.
  (copy_hunk_text): Copy whole lines since there is no leading diff
    symbols.
]]]

/Daniel

------------------------------------------------------
http://subversion.tigris.org/ds/viewMessage.do?dsForumId=462&dsMessageId=2391685

Received on 2009-09-06 21:48:34 CEST

This is an archived mail posted to the Subversion Dev mailing list.

This site is subject to the Apache Privacy Policy and the Apache Public Forum Archive Policy.