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

[PATCH] #3356 svn patch ignores svn:eol-style

From: Daniel Näslund <daniel_at_longitudo.com>
Date: Tue, 19 Jan 2010 19:25:14 +0100

Hi!

This is not a finished patch.

I've added mark and seek handlers to svn_subst_stream_translated().
Those two handlers are just wrappers that calls the underlying
streams handlers. Now that works in my test but what happens if we set a
mark in front of what we've read so far from the file? We might end up
with an off-by-one caused by one dropped '\r' causing the hunk to be
applied at the wrong line. I guess we could forbid a mark from beeing
set in front of the last character read so far but that would be a
restraint that would look strange on the outside. What to do?

If we plan to add keyword expansion in the future, things would get even
more complex.

Right now I open a translated stream for all cases when there's a
svn:eol-style property. In reality it's only needed when the eol of the
file differs from the property. I will fix that if there's a solution to
'the seekable translated stream' problem.

[[[
Fix #3356 - svn patch ignores svn:eol-style. When the eol in the file to
be patched differed from the svn:eol-style prop the code now translates
to the prop eol. To do that we need to use svn_subst_stream_translated
on a stream that needs to be seekable.

* subversion/libsvn_subr/subst.c
  (translated_stream_mark): New.
  (translated_stream_seek): New.
  (svn_subst_straem_translated): Set seek and mark functions.

* subversion/libsvn_client/patch.c
  (init_patch_target): Check if there is a svn:eol-style prop set on the
    file to be patched. If it is we translate the eols of both the file
    and the patch to that value.

* subversion/tests/cmdline/patch_tests.py
  (patch_handle_eol): New.
  (test_list): Add the new test.

Patch by: Daniel Näslund <daniel{_AT_}longitudo.com>
]]]

Received on 2010-01-19 19:25:52 CET

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.