internal static bool CanBrowse(SVNPath path) { if (path == null) { return false; } return (path.Source.IsURL || FileSystemHelper.IsUrl(path.FilePath)); }
internal static bool CanCopyFullName(SVNPath path) { if (path == null) { return false; } return true; }
internal static bool CanDiff(SVNPath path) { if (path == null) { return false; } if ((path.Action != SVNAction.Modified) && (path.Action != SVNAction.Replaced)) { return false; } return true; }
internal static bool CanCommit(SVNPath path) { if (path == null) { return false; } if (!ApplicationSettingsManager.Settings.CommitIsAlwaysEnabled && !path.Modified) { return false; } return true; }
internal static bool CanBlame(SVNPath path) { if (path == null) { return false; } if (path.Action == SVNAction.Deleted) { return false; } return true; }
private static SVNLog SharpSVNToSVNLog(Source source, Collection<SvnLogEventArgs> collection, SVNInfo info, Collection<SvnStatusEventArgs> statusCollection) { SVNLog log = new SVNLog(); Dictionary<string, SvnStatusEventArgs> statusMap = GetStatusMap(statusCollection); foreach (SvnLogEventArgs logItem in collection) { DateTime localTime = logItem.Time.ToLocalTime(); SVNLogEntry entry = new SVNLogEntry(source, logItem.Revision, logItem.Author, localTime, logItem.LogMessage); SvnChangeItemCollection items = logItem.ChangedPaths; if (items != null) { List<SVNPath> paths = new List<SVNPath>(); foreach (SvnChangeItem item in items) { SVNPath path = new SVNPath(entry, SVNActionConverter.ToSVNAction(item.Action), item.Path); string pathName = item.Path; if (pathName.StartsWith("/")) { pathName = pathName.Substring(1); } string pathUri = info.RepositoryRoot + pathName; path.Uri = pathUri; if (statusMap.ContainsKey(pathUri)) { SvnStatusEventArgs statusItem = statusMap[pathUri]; path.FilePath = statusItem.FullPath; } else { string filePath = SVNPath.GuessFilePath(entry, path.Name, info); if (FileSystemHelper.Exists(filePath)) { path.FilePath = filePath; } else { path.FilePath = pathUri; } } paths.Add(path); } entry.Paths = paths; log.LogEntries.Add(entry); } } return log; }
internal static bool CanEdit(SVNPath path) { if (path == null) { return false; } if (!path.Source.PathExists) { return false; } if (!FileSystemHelper.FileExists(path.FilePath)) { return false; } return true; }
internal static bool CanCopyURL(SVNPath path) { return (path != null); }
internal static bool CanCopyToClipboard(SVNPath path) { return (path != null); }
internal static bool CanSVNUpdate(SVNPath path) { if (path == null) { return false; } if (path.Source.IsURL) { return false; } return true; }
internal static bool CanRunPathWizard(SVNPath path) { return (path != null); }
internal static bool CanRollback(SVNPath path) { if (path == null) { return false; } return (!path.Source.IsURL && !path.Unread); }
internal static bool CanRevert(SVNPath path) { if (path == null) { return false; } return path.Modified; }
internal static bool CanOpenSVNLog(SVNPath path) { return (path != null); }
internal static bool CanExport(SVNPath path) { if (path == null) { return false; } if (path.ExistsLocally) { return FileSystemHelper.FileExists(path.FilePath); } return true; }
private void CreateTipTextForSinglePath(SVNPath path) { StringBuilder sb = new StringBuilder(); SVNLogEntry logEntry = path.LogEntry; sb.AppendFormat("{0} has updated {1}:{2}", logEntry.Author, logEntry.SourceName, Environment.NewLine); sb.AppendLine(logEntry.Message); sb.AppendLine(path.FilePath); TipText = sb.ToString(); }