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

Synchronize View Problems

From: Mark Phippard <MarkP_at_softlanding.com>
Date: 2005-02-17 21:00:47 CET

This is probably directed mostly to Panagiotis Korros but I would welcome
contributions or assistance from anyone that wants to look at this.

I think the whole Synch view stuff is still a tad flaky, although it works
pretty well now. There is still however one nagging problem that I cannot
solve and I am close to giving up on it.

The problem is that outgoing deletes are not removed from the Synchronize
View after they are committed.

Looking at the source for SVNWorkspaceSubscriber, it would seem that this
might have been a known problem. I say this because of this method:

    private void internalResourceChanged(IResource[] changedResources) {
        for (int i = 0; i < changedResources.length; i++) {
            IResource resource = changedResources[i];
            try {
                if( resource.exists() ) {
                  <snip>
                }
//TODO: catch outgoing deletions
// else {
// if( remoteSyncStateStore.getBytes( resource ) ==
null ) {
// localSyncStateStore.deleteBytes( resource );
// }
// else {
// StatusInfo localInfo = new StatusInfo(null,
SVNStatusKind.NONE );
// localSyncStateStore.setBytes( resource,
localInfo.asBytes() );
// }
// }
            } catch (TeamException e) {
                e.printStackTrace();
            }
        }
 fireTeamResourceChange(SubscriberChangeEvent.asSyncChangedDeltas(this,
changedResources));
    }

Note the TODO comments.

I've experimented, trying to figure out what it is that needs to be done,
but so far with no luck.

Here's a simple example showing what I observe happening when I debug the
code:

Folder1(project)
        Folder2(package)
                File1 (java)
                File2 (java)
                File3 (java)

I change File1 and delete File2, then run synchronize on Folder1. The
synchronize view shows the outgoing modification and deletion.

I commit the modification and the deletion. I see the following methods
being called in SVNWorkspaceSubscriber:

resourceSyncInfoChanged(IResource[] changedResources)

        changedResources = { Folder2, File1, File3 }

        Note that the array contains the changed file and the unchanged
file, but not the deleted file.

getSyncInfo(IResource resource)

        This method is called for Folder2, File1 and File3, but not for
File2.

The modified file (File1) is removed from the Synchronize view, but not
the deleted file.

Now, if I do another synchronization, the deleted file is sometimes
removed and sometimes not. I'm having trouble determining the pattern. It
might be that it is removed only if I do a synchronization of a resource
that is not the same as the resource currently in the synchronize view. In
other words, if I do another synchronize on Folder1, the committed
deletion is still not removed. But if I do a synchronize on Folder2, it
is.

I have tried looking at the CVS code to figure this out, but there are
enough differences that is hard to track anything down. I suspect that
our CommitOperation should be doing something to trigger the appropriate
refresh when a deletion is committed. But I haven't been able to figure
out how to do it or what exactly to refresh.

Patches would be welcome!

Thanks

Mark

_____________________________________________________________________________
Scanned for SoftLanding Systems, Inc. by IBM Email Security Management Services powered by MessageLabs.
_____________________________________________________________________________
Received on Fri Feb 18 07:00:47 2005

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