> From: Sander Striker [mailto:striker@apache.org]
> Sent: 06 August 2002 19:04
[...]
>> My other thought is regarding your question about the STRICT flag to
>> svn_wc_statuses(). The doc string says:
>>
>> If STRICT is non-zero, then if we encounter a path that is not in
>> the wc, we'll return an error. STRICT should be zero if we're
>> updating, as the update will catch any non wc path errors (and
>> properly deal with files that are in the repository but missing
>> from the wc for whatever reason).
>>
>> At first I thought "not in the wc" meant the same as "unversioned",
>> but the following code in assemble_status() shows what's really going
>> on. This is the only place where `strict' is actually used, instead
>> of just passed along:
>>
>> /* If we're in strict mode and we encounter a path that doesn't
>> exist in the wc, then we return an error*/
>> if (strict && (path_kind == svn_node_none))
>> return svn_error_createf (APR_ENOENT, 0, NULL, pool,
>> "assemble_status: "
>> "%s: No such file or directory",
>> path);
>>
>> So STRICT is about returning an error instead of storing code
>> svn_wc_status_absent. Thus, strictly speaking, you don't have to pay
>> attention to STRICT. But in real life, I think it would be best to
>> see who is passing the STRICT flag to svn_wc_statuses(), and why, and
>> consider whether those cases will be affected by this new
>> svn_wc_status_obstructed code. And if you want to clarify the
>> description of STRICT semantics in the doc string for
>> svn_wc_statuses(), that'd be great :-).
>
> Hrmm... Ok, I'll see if I can identify the callers that use STRICT...
Did that:
subversion/libsvn_client/delete.c (svn_client__can_delete):
SVN_ERR (svn_wc_statuses (hash, path, TRUE, FALSE, TRUE, FALSE, pool));
^^^^
subversion/libsvn_client/status.c (svn_client_status):
/* If we're not updating, we might be getting new paths from the
repository, and we don't want svn_wc_statuses to error on these
paths. However, if we're not updating and we see a path that
doesn't exist in the wc, we should throw an error */
if (update)
strict = FALSE;
else
strict = TRUE;
Now, on the working of STRICT... currently it doesn't do anything (I think).
The check is:
if (! entry)
{
...
/* If we're in strict mode and we encounter a path that doesn't
exist in the wc, then we return an error*/
if (strict && (path_kind == svn_node_none))
return svn_error_createf (APR_ENOENT, 0, NULL, pool,
"assemble_status: "
"%s: No such file or directory",
path);
IOW, there is no entry and the path doesn't exist in the filesystem. This
can never happen (or can it??). Can someone please explain what it is
supposed to do?
Personally I feel that we should implement STRICT to return an error
whenever a resource is either obstructed or absent. Returning error
on absense is disputable, since there is checking in place for
svn_wc_status_absent in at least one of the callers of svn_wc_statuses
(svn_client__can_delete). Maybe that caller shouldn't use STRICT
and just grow knowledge of svn_wc_status_obstructed?
Anyhow, the patch attached does add svn_status_obstructed and handles
STRICT as I describe above, but... I get a bunch o' failing tests :(
At least one test FAILED, checking /opt/src/build/subversion/tests.log
FAIL: basic_tests.py 1: basic checkout of a wc
FAIL: basic_tests.py 8: basic cleanup command
FAIL: basic_tests.py 11: basic delete command
FAIL: basic_tests.py 13: attempt to change node kind
FAIL: commit_tests.py 1: commit one file.
FAIL: commit_tests.py 2: commit one newly added file.
FAIL: commit_tests.py 3: commit multiple targets
FAIL: commit_tests.py 4: commit multiple targets, 2nd variation
FAIL: commit_tests.py 5: commit wc_dir/A/D -- includes D. (anchor=A, tgt=D)
FAIL: commit_tests.py 6: commit wc_dir -- (anchor=wc_dir, tgt={})
FAIL: commit_tests.py 8: replace two nested dirs, verify empty contents
FAIL: commit_tests.py 21: commit the current directory
FAIL: prop_tests.py 1: write/read props in wc only (ps, pl, pdel)
FAIL: prop_tests.py 2: commit properties
FAIL: prop_tests.py 3: receive properties via update
FAIL: prop_tests.py 6: update with conflicting props
FAIL: schedule_tests.py 2: schedule: add some directories
FAIL: schedule_tests.py 3: schedule: add some nested files and directories
FAIL: schedule_tests.py 5: schedule: delete some directories
FAIL: schedule_tests.py 7: revert: add some directories
FAIL: schedule_tests.py 8: revert: add some nested files and directories
FAIL: schedule_tests.py 10: revert: delete some directories
FAIL: log_tests.py 1: 'svn log', no args, top of wc.
If anyone can please take a look at this ;)
Thanks,
Sander
---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@subversion.tigris.org
For additional commands, e-mail: dev-help@subversion.tigris.org
Received on Wed Aug 7 19:51:11 2002