Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.
Bug 330290 - SVNTeamModificationValidator does not take into account LockProposeUtility.proposeLock(..) returned status
Summary: SVNTeamModificationValidator does not take into account LockProposeUtility.pr...
Status: RESOLVED FIXED
Alias: None
Product: Subversive
Classification: Technology
Component: UI (show other bugs)
Version: unspecified   Edit
Hardware: PC Windows XP
: P3 normal (vote)
Target Milestone: ---   Edit
Assignee: Igor Burilo CLA
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2010-11-15 16:11 EST by Stephane fournier CLA
Modified: 2010-11-16 13:06 EST (History)
1 user (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Stephane fournier CLA 2010-11-15 16:11:20 EST
Build Identifier: 0.7.8

When SVNTeamModificationValidator is called to validateEdit files controlled by subversive with SVN lock usage, SVNTeamModificationValidator#validateEdit(IFile[] files, final FileModificationValidationContext context) does not rely on LockProposeUtility.proposeLock(needsLockResources) to create the returned status.

Here is a possible fix, CANCEL_STATUS is returned if locks fails to be taken :

  public IStatus validateEdit(IFile[] files, final FileModificationValidationContext context) {
    IStatus resultingStatus = Status.OK_STATUS;
    if (FileUtility.isConnected(files[0])) {
      final IResource[] needsLockResources = this.getNeedsLockResources(files);
      if (needsLockResources.length > 0) {
        if (!LockProposeUtility.proposeLock(needsLockResources)){
          resultingStatus = Status.CANCEL_STATUS;
        }
      }
    }
    return resultingStatus;
  }



Reproducible: Always

Steps to Reproduce:
1.Make a change in a file controlled by SVN with lock enabled.
2. cancel the lock when the popup is prompted.

>> SVNTeamModificationValidator#validateEdit returns OK status.
Comment 1 Alexander Gurov CLA 2010-11-16 13:06:11 EST
Fixed.