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

Re: svn_wc_add_from_disk2 doesn't support skip_some_checks

From: Julian Foad <julianfoad_at_btopenworld.com>
Date: Wed, 27 Mar 2013 14:19:51 +0000 (GMT)

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).

Received on 2013-03-27 15:24:35 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.