internal protected virtual VersionControlOperation GetSupportedOperations (VersionInfo vinfo)
{
VersionControlOperation operations = VersionControlOperation.None;
bool exists = !vinfo.LocalPath.IsNullOrEmpty && (File.Exists (vinfo.LocalPath) || Directory.Exists (vinfo.LocalPath));
if (vinfo.IsVersioned) {
operations = VersionControlOperation.Commit | VersionControlOperation.Update;
if (!vinfo.HasLocalChange (VersionStatus.ScheduledAdd))
operations |= VersionControlOperation.Log;
if (exists) {
if (!vinfo.HasLocalChange (VersionStatus.ScheduledDelete))
operations |= VersionControlOperation.Remove;
if (vinfo.HasLocalChanges || vinfo.IsDirectory)
operations |= VersionControlOperation.Revert;
}
if (AllowLocking && !vinfo.IsDirectory) {
if (!vinfo.HasLocalChanges && (vinfo.Status & VersionStatus.LockOwned) == 0)
operations |= VersionControlOperation.Lock;
if ((vinfo.Status & VersionStatus.LockOwned) != 0)
operations |= VersionControlOperation.Unlock;
}
}
else if (exists) {
operations = VersionControlOperation.Add;
}
return operations;
}