You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@subversion.apache.org by Marshall Schor <ms...@schor.com> on 2013/03/26 20:29:43 UTC

Misleading error report

I recently created some new binary files.  I happened to pick a name for these
that ended in ".data", thinking that would remind me and others in the future
that this was just data.

Because I'm an Apache committer, I had followed the svn config setup in
http://apache.org/dev/svn-eol-style.txt.  I had done this many years ago :-).

When I tried to commit the new data files to SVN, I got this error message:

add -N C:\xxxx....\xxx.data
    Illegal target for the requested operation
svn: File 'C:\xxxx....\xxx.data' has binary mime type property

I'm sorry to say this message wasn't very helpful.  I knew the file was
"binary".  I've added binary files before to SVN.  This message gave no reason
why the file was "illegal".

The answer turned out to be in that Apache standard configuration file for SVN -
it specified that files ending with ".data" should have the svn property
svn:eol-style=native.

A wonderful error message would have been something like the following:

Illegal target for the requested operation because the target file is a binary
file, and that is conflicting with the svn property eol-style=native, which is
automatically being added because the file type is matching a rule for this in
the svn configuration file, located here: xxxx; fix this by any of the following
actions:  change the file type to something that doesn't match a rule in the
configuration file that is adding the conflicting property, or change the
configuration file rules to not add the conflicting property.

I'm not subscribed to the list, so if you wish, please cc: me on any replies.

-Marshall Schor

Re: svn_wc_add_from_disk2 doesn't support skip_some_checks

Posted by Daniel Shahaf <d....@daniel.shahaf.name>.
Philip Martin wrote on Tue, Mar 26, 2013 at 22:15:22 +0000:
> Daniel Shahaf <d....@daniel.shahaf.name> writes:
> 
> > Marshall Schor wrote on Tue, Mar 26, 2013 at 15:29:43 -0400:
> >> I recently created some new binary files.  I happened to pick a name for these
> >> that ended in ".data", thinking that would remind me and others in the future
> >> that this was just data.
> >> 
> >
> > Thanks, r1461328.
> 
> "svn add" won't add files that set both a binary svn:mime-type and an
> svn:eol-style.  The low level function that checks the properties has a
> skip_some_checks flag to allow the combination which is how both
> properties can be set using "svn propset --force".  "svn add" also has
> --force but it doesn't work to add the file with both properties because
> svn_wc_add_from_disk2 doesn't support skip_some_checks.  This is
> explicitly mentioned in the docs:
> 
>  * Check and canonicalize the properties in the same way as
>  * svn_wc_prop_set4().  Return an error and don't add the node if the
>  * properties are not valid on this node.  Unlike svn_wc_prop_set4()
>  * there is no option to skip some of the checks and canonicalizations.
> 
> but without any rationale.  This function is new in 1.8 so we could
> easily change it.  Does anyone remember why the function behaves this
> way?

Wild guess: perhaps it's just our general trend to avoid --force in
favour of more-specific options?

Re: svn_wc_add_from_disk2 doesn't support skip_some_checks

Posted by Julian Foad <ju...@btopenworld.com>.
Bert Huijben wrote:
>  Philip Martin wrote:
>>  "svn add" won't add files that set both a binary svn:mime-type and an
>>  svn:eol-style.  The low level function that checks the properties has a
>>  skip_some_checks flag to allow the combination which is how both
>>  properties can be set using "svn propset --force".  "svn add" also has
>>  --force but it doesn't work to add the file with both properties because
>>  svn_wc_add_from_disk2 doesn't support skip_some_checks.  This is
>>  explicitly mentioned in the docs:
>> 
>>   * Check and canonicalize the properties in the same way as
>>   * svn_wc_prop_set4().  Return an error and don't add the node if the
>>   * properties are not valid on this node.  Unlike svn_wc_prop_set4()
>>   * there is no option to skip some of the checks and canonicalizations.
>> 
>>  but without any rationale.  This function is new in 1.8 so we could
>>  easily change it.  Does anyone remember why the function behaves this
>>  way?
> 
> Julian made the add function atomic, instead of add + propset and on error
> revert.

FWIW, I also added some comments here and there, probably including the one above, to describe the current behaviour.  That doesn't mean I know why it behaves that way or that I agree that it should.  I can't think of any reason why it should not support the 'skip some checks' option.

- Julian


> And I tried to make this canonicalize behavior optional, but halfway through
> the patch I found different related issues that made the problem space much
> harder than I anticipated.
> 
> The --force flag also disables other checks such as on svn:mergeinfo and all
> other properties, so by resolving one particular issue it will most likely
> introduce several others.
> 
> And there are other checks on the mimetype that can cause related problems.
> (And libsvn magic combined with these other problems might cause even more
> problems).
> 
> I added a few tests on these strange cases in trans_tests.py in r1449522 and
> r1449559.
> 
> We probably really need some kinds of checks here, while we would only like
> to skip the actual file check that just checks if the file has normalized
> eols. (We will check that again at commit time, so it involves no risk of
> getting invalid state committed).

[...]


RE: svn_wc_add_from_disk2 doesn't support skip_some_checks

Posted by Bert Huijben <be...@qqmail.nl>.

> -----Original Message-----
> From: MARTIN PHILIP [mailto:codematters@ntlworld.com] On Behalf Of
> Philip Martin
> Sent: dinsdag 26 maart 2013 23:15
> To: Daniel Shahaf
> Cc: Marshall Schor; dev@subversion.apache.org
> Subject: svn_wc_add_from_disk2 doesn't support skip_some_checks
> 
> Daniel Shahaf <d....@daniel.shahaf.name> writes:
> 
> > Marshall Schor wrote on Tue, Mar 26, 2013 at 15:29:43 -0400:
> >> I recently created some new binary files.  I happened to pick a name
for
> these
> >> that ended in ".data", thinking that would remind me and others in the
> future
> >> that this was just data.
> >>
> >
> > Thanks, r1461328.
> 
> "svn add" won't add files that set both a binary svn:mime-type and an
> svn:eol-style.  The low level function that checks the properties has a
> skip_some_checks flag to allow the combination which is how both
> properties can be set using "svn propset --force".  "svn add" also has
> --force but it doesn't work to add the file with both properties because
> svn_wc_add_from_disk2 doesn't support skip_some_checks.  This is
> explicitly mentioned in the docs:
> 
>  * Check and canonicalize the properties in the same way as
>  * svn_wc_prop_set4().  Return an error and don't add the node if the
>  * properties are not valid on this node.  Unlike svn_wc_prop_set4()
>  * there is no option to skip some of the checks and canonicalizations.
> 
> but without any rationale.  This function is new in 1.8 so we could
> easily change it.  Does anyone remember why the function behaves this
> way?

Julian made the add function atomic, instead of add + propset and on error
revert.

And I tried to make this canonicalize behavior optional, but halfway through
the patch I found different related issues that made the problem space much
harder than I anticipated.

The --force flag also disables other checks such as on svn:mergeinfo and all
other properties, so by resolving one particular issue it will most likely
introduce several others.

And there are other checks on the mimetype that can cause related problems.
(And libsvn magic combined with these other problems might cause even more
problems).

I added a few tests on these strange cases in trans_tests.py in r1449522 and
r1449559.

We probably really need some kinds of checks here, while we would only like
to skip the actual file check that just checks if the file has normalized
eols. (We will check that again at commit time, so it involves no risk of
getting invalid state committed).

I haven't dived deeper in this problem space as after fixing any small
problem a similar remaining one turned up.
(I reverted my work and continued with the other work)

	Bert


svn_wc_add_from_disk2 doesn't support skip_some_checks

Posted by Philip Martin <ph...@wandisco.com>.
Daniel Shahaf <d....@daniel.shahaf.name> writes:

> Marshall Schor wrote on Tue, Mar 26, 2013 at 15:29:43 -0400:
>> I recently created some new binary files.  I happened to pick a name for these
>> that ended in ".data", thinking that would remind me and others in the future
>> that this was just data.
>> 
>
> Thanks, r1461328.

"svn add" won't add files that set both a binary svn:mime-type and an
svn:eol-style.  The low level function that checks the properties has a
skip_some_checks flag to allow the combination which is how both
properties can be set using "svn propset --force".  "svn add" also has
--force but it doesn't work to add the file with both properties because
svn_wc_add_from_disk2 doesn't support skip_some_checks.  This is
explicitly mentioned in the docs:

 * Check and canonicalize the properties in the same way as
 * svn_wc_prop_set4().  Return an error and don't add the node if the
 * properties are not valid on this node.  Unlike svn_wc_prop_set4()
 * there is no option to skip some of the checks and canonicalizations.

but without any rationale.  This function is new in 1.8 so we could
easily change it.  Does anyone remember why the function behaves this
way?

-- 
Certified & Supported Apache Subversion Downloads:
http://www.wandisco.com/subversion/download

Re: Misleading error report

Posted by Daniel Shahaf <d....@daniel.shahaf.name>.
Marshall Schor wrote on Tue, Mar 26, 2013 at 15:29:43 -0400:
> I recently created some new binary files.  I happened to pick a name for these
> that ended in ".data", thinking that would remind me and others in the future
> that this was just data.
> 

Thanks, r1461328.