List Info

Thread: SVNStatusUtils.isReadyForCommit() returns true for unversioned resources?




SVNStatusUtils.isReadyForCommit() returns true for unversioned resources?
user name
2007-09-11 07:13:18
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-unsubscribesubclipse.tigris.org
For additional commands, e-mail: users-helpsubclipse.tigris.org


Re: SVNStatusUtils.isReadyForCommit() returns true for unversioned resources?
user name
2007-09-11 07:52:29
On 9/11/07, Rainer Koschnick <rainerkebuconnect.de> wrote:
> 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


I guess you'll have to then.  Subclipse wants unversioned
items to
show in its commit dialog which is why they are included in
this
method.  It is just a helper method, create your own with
the logic
you want.

-- 
Thanks

Mark Phippard
http://markphip.blogspo
t.com/

------------------------------------------------------------
---------
To unsubscribe, e-mail: users-unsubscribesubclipse.tigris.org
For additional commands, e-mail: users-helpsubclipse.tigris.org


[1-2]

about | contact  Other archives ( Real Estate discussion Medical topics )