On Tue, Feb 23, 2010 at 08:57:26PM +0100, Daniel Näslund wrote:
> On Tue, Feb 02, 2010 at 09:11:52PM +0100, Stefan Sperling wrote:
> > On Tue, Feb 02, 2010 at 08:48:43PM +0100, Daniel Näslund wrote:
> What to do?
> [ ] Write documentation saying we can only repair eols on targets with a
> svn:eol-style prop.
> [ ] Wrap the error for a better error message perhaps saying 'patch and
> target uses different eol' or similar.
> [ ] Adjust the code to allow for repairing eols even when there is no
> svn:eol-style prop. I would go for this one if it's doable.
> Before I throw myself to the mercy of the eol-translating code, I ask
> you if there is something you know of hindering us from repairing eols
> where there is no prop set?
> In init_patch_target() we decide how the eol translation of
> target->patched will be done:
> eol_style_val = apr_hash_get(props, SVN_PROP_EOL_STYLE,
> if (eol_style_val)
> /* Just use the first EOL sequence we can find in the file. */
> target->file, scratch_pool));
> /* But don't enforce any particular EOL-style. */
> target->eol_style = svn_subst_eol_style_none;
> target->patched = svn_subst_stream_translated(
> target->eol_style ==
> target->keywords, TRUE, result_pool);
> You decided to not enforce any particular eol-style if we don't have a
> prop. The eol_style is used for the cases where there is an eol-style
> prop. Fair enough. But couldn't we do some hack where we always say that
> the eol-style is fixed and use whatever eol we find in the target? I did
> a quick try and got a lot of rejected hunks...
> What can go wrong with this approach?
> * We falsely label targets with inconsistent eols to be of type
> eol_style_fixed. But after patching the eols will be consistent and
> that's a good thing.
> * [Placeholder for more stuff that can go wrong]
> Or we could set the style to svn_subst_eol_style_native. We will end up
> with native newlines in the target then, right?
Oups, lost the thread there. The eol-style was only used to check for
style_fixed, and if so translate eols. The question remains; why
can't we translate files when there is no no eol-style prop. Is it worth
Received on 2010-02-23 21:35:59 CET