[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: Peter N. Lundblad <peter_at_famlundblad.se>
Date: 2006-01-30 18:42:58 CET

On Mon, 30 Jan 2006 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"? :-)
>
No, I menat repository. The crash happens when there is an item that is
ignored (i.e. matches the ignore patterns), and thereby, by definition
unversioned (see below) and then an entry by the same name is in the
repository. This will be reported as "added" by the repository status
code. Maybe I was too terse here.

> 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 think that's the definition of the ignored status. How could a path be
versioned and ignored? So it makes sense that this value dominates.

Regarding Malcolm's question about simplifying the conditional expression,
I could go either way. I think (but am too lazy to check right now) that
other code in this file relies on entry being NULL to mean "unversioned".
But, this being a change intended for backport, I don't want to do this
simplicifaction in the fix.

Regards,
//Peter

---------------------------------------------------------------------
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:46:25 2006

This is an archived mail posted to the Subversion Dev mailing list.