Javier Kohen wrote,
> 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.
the Javadoc shows the following:
/**
* Answer whether the status is "outgoing",
i.e. whether resource
with such status could/should be commited
* param status
* return true when the status represents
"outgoing" state
*/
and I don't think that an unversioned folder has an outgoing
state and
could actually be committed (it needs to be added first) so
either the
method name and the description are misleading or the
implementation is
wrong.
I use it to find modified files for a commit dialog and as
is it's not
of much use. I'll probably just write my own I guess
Cheers,
Rainer
------------------------------------------------------------
---------
To unsubscribe, e-mail: users-unsubscribe subclipse.tigris.org
For additional commands, e-mail: users-help subclipse.tigris.org
|