RE: Re: RE: [Subclipse-dev] Bug introduced with 1.1.9 - LockDialog
From: Thomas M. Hofmann <email_at_thomashofmann.com>
Date: 2006-12-11 21:09:17 CET
Hi again,
String comment = "";
boolean stealLock = false;
// reduce the array to just read only files
IFile[] readOnlyFiles = getReadOnly(files); <- Ok these are the read only files
int managedCount = readOnlyFiles.length;
SVNTeamProvider svnTeamProvider = null;
RepositoryProvider provider = RepositoryProvider.getProvider(files[0].getProject());
if ((provider != null) && (provider instanceof SVNTeamProvider)) {
IFile[] managedFiles = checkManaged(files); <- These are the managed files. The can be read only or writable.
managedCount = managedFiles.length;
if (managedCount > 0) { <- the condition is true for the writable files that are managed too!
if (context != null) {
ISVNFileModificationValidatorPrompt svnFileModificationValidatorPrompt =
SVNProviderPlugin.getPlugin().getSvnFileModificationValidatorPrompt();
if (svnFileModificationValidatorPrompt != null) {
if (!svnFileModificationValidatorPrompt.prompt(managedFiles, context)) <- This is were the dialog gets trigged.
return Status.CANCEL_STATUS;
comment = svnFileModificationValidatorPrompt.getComment();
stealLock = svnFileModificationValidatorPrompt.isStealLock();
}
}
svnTeamProvider = (SVNTeamProvider) provider;
LockResourcesCommand command = new LockResourcesCommand(svnTeamProvider.getSVNWorkspaceRoot(), managedFiles, stealLock, comment);
try {
command.run(new NullProgressMonitor());
} catch (SVNException e) {
e.printStackTrace();
return Status.CANCEL_STATUS;
}
}
}
// This is to prompt the user to flip the read only bit
// on files that are not managed by SVN
if (readOnlyFiles.length > managedCount) { <- OK if there are more read only than managed there must be some read only not managed
synchronized (this) {
if (uiValidator == null)
uiValidator = loadUIValidator();
}
if (uiValidator != null) {
return uiValidator.validateEdit(files, context); <- Is this correct? Shouldn't only the files not managed and read only be passed here?
}
// There was no plugged in validator so fail gracefully
return getStatus(files);
}
return Status.OK_STATUS;
}
________________________________
From: Mark Phippard [mailto:markphip@gmail.com]
On 12/11/06, Thomas M. Hofmann <email@thomashofmann.com> wrote:
Hi Mark,
I think that RSA is telling Eclipse that the file is read-only. That is why all of these checks that should be eliminating the file are not working. They are all using the same internal Eclipse cache. By using the Java File object it will fix it unless the files really are read only. In which case, it is all working properly anyway.
I'd all but guarantee this change will fix it.
Mark
---------------------------------------------------------------------
|
This is an archived mail posted to the Subclipse Dev mailing list.
This site is subject to the Apache Privacy Policy and the Apache Public Forum Archive Policy.