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

Re: [Subclipse-users] SVNStatusUtils.isReadyForCommit() returns true for unversioned resources?

From: Javier Kohen <jkohen_at_users.sourceforge.net>
Date: 2007-09-11 11:51:02 CEST

Hi,

El mar, 11-09-2007 a las 17:34 +0800, Rainer Koschnick escribió:
> Hello,
>
> just noticed that SVNStatusUtils.isReadyForCommit() returns true for a
> folder which is not part of my working copy.
>
> public static boolean isReadyForCommit(ISVNStatus status) {
> return isTextModified(status) || isAdded(status) ||
> isDeleted(status) || isReplaced(status) || isPropModified(status)
> || isTextConflicted(status) || isPropConflicted(status) ||
> (!isManaged(status) && !isIgnored(status));
> }
>
> I think the problem is the last OR which should probably be an AND.
>
> || (!isManaged(status) && !isIgnored(status))
>
> ..
>
> && (!isManaged(status) && !isIgnored(status))

Although I don't know the API definition for this method, I would guess
that it's what's used to populate the list of files to commit. The
originally version is basically allowing you to commit resources that
are neither versioned nor being ignored, and I think that's pretty
useful, since it saves you adding them by hand.

Leaving semantic aside, your version, on the other hand, probably
suffers from operator precedence issues. && has higher priority than ||
and thus you are grouping isPropConflicted with !isManaged and !
isIgnored (the parentheses become redundant, by the way) ― I personally
don't see the sense in that.

Cheers,

-- 
Javier Kohen <jkohen@users.sourceforge.net>
ICQ: blashyrkh #2361802
Jabber: jkohen@jabber.org

Received on Tue Sep 11 11:48:08 2007

This is an archived mail posted to the Subclipse Users mailing list.

This site is subject to the Apache Privacy Policy and the Apache Public Forum Archive Policy.