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

Re: svn commit: r18291 - in trunk/subversion: libsvn_wc tests/cmdline

From: Julian Foad <julianfoad_at_btopenworld.com>
Date: 2006-01-30 18:33:47 CET

kfogel@collab.net wrote:
> lundblad@tigris.org writes:
>
>>Log:
>>Fix crash in svn status -u when an unversioned and ignored directory
>>is in the repository.
>>
>>Found by: Stefan Küng <tortoisesvn@gmail.com>
>>
>>* subversion/libsvn_wc/status.c (make_dir_baton): Don't try to get status
>> of ignored directory.
>>
>>* subversion/tests/cmdline/stat_tests.py
>> (status_ignored_dir): New test.
>> (test_list): Run it.
>
>
> The log says the crash happens "when an unversioned and ignored
> directory is in the repository".
>
> First, did you mean "working copy" instead of "repository"? :-)
>
> Second, a question about the code, see below...
>
>
>>--- trunk/subversion/libsvn_wc/status.c (original)
>>+++ trunk/subversion/libsvn_wc/status.c Mon Jan 30 08:32:54 2006
>>@@ -1155,13 +1155,14 @@
>> /* Order is important here. We can't depend on parent_status->entry
>> being non-NULL until after we've checked all the conditions that
>> might indicate that the parent is unversioned ("unversioned" for
>>- our purposes includes being an external). */
>>+ our purposes includes being an external or ignored item). */
>> if (parent_status
>> && (parent_status->text_status != svn_wc_status_unversioned)
>> && (parent_status->text_status != svn_wc_status_deleted)
>> && (parent_status->text_status != svn_wc_status_missing)
>> && (parent_status->text_status != svn_wc_status_obstructed)
>> && (parent_status->text_status != svn_wc_status_external)
>>+ && (parent_status->text_status != svn_wc_status_ignored)
>> && (parent_status->entry->kind == svn_node_dir)
>> && (eb->descend || (! pb)))
>> {
>
>
> This conditional gets the entry's status if parent_status is *neither*
> unversioned nor ignored. Is it the case that if an object is both
> ignored and unversioned, its text_status will be 'ignored' not
> 'unversioned'? In other words, the crash was happening because even
> though the item *was* unversioned, the 'ignore' part dominated, so the
> text_status said nothing about its being unversioned?

I believe the status "..._ignored" denotes a sub-set of unversioned items, and
"..._unversioned" the rest of the unversioned items. Therefore, yes, the
status of such an item will be "..._ignored".

Since this is not entirely obvious, and furthermore I remember getting confused
by it (possibly by the corresponding output of "svn status" at the user level)
when I was new to Subversion, I think we want a comment somewhere. How about this:

[[[
Clarify that the "ignored" status only applies to unversioned items.

* subversion/include/svn_wc.h
   (svn_wc_status_ignored): Expand the doc string.
]]]

Index: subversion/include/svn_wc.h
===================================================================
--- subversion/include/svn_wc.h (revision 18266)
+++ subversion/include/svn_wc.h (working copy)
@@ -1612,7 +1612,7 @@
      /** local mods received conflicting repos mods */
      svn_wc_status_conflicted,

- /** a resource marked as ignored */
+ /** is unversioned but configured to be ignored */
      svn_wc_status_ignored,

      /** an unversioned resource is in the way of the versioned resource */

- Julian

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@subversion.tigris.org
For additional commands, e-mail: dev-help@subversion.tigris.org
Received on Mon Jan 30 18:37:21 2006

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.