public static void CommitRecommend(Source source, long revision, string logMessage) { source.RefreshRecommended(); List<long> list = new List<long>(); list.AddRange(source.ReadOnlyRecommendedRevisions); if (!list.Contains(revision)) { list.Add(revision); list.Sort(); StringBuilder sb = new StringBuilder(); foreach (long rev in list) { sb.AppendLine(rev.ToString()); } using (SvnClient client = GetSvnClient(source)) { SvnCommitArgs args = new SvnCommitArgs(); args.LogProperties.Add("svnmonitor:recommend", sb.ToString()); args.ThrowOnError = true; args.LogMessage = logMessage; args.Depth = SvnDepth.Empty; client.Commit(source.Path, args); } } }
internal static bool CanCopyConflictedItems(Source source) { if (source == null) { return false; } return (source.PossibleConflictedFilePathsCount > 0); }
internal static bool CanCopyModifiedItems(Source source) { if (source == null) { return false; } return (source.ModifiedCount > 0); }
internal static SVNInfo GetInfo(Source source) { Collection<SvnInfoEventArgs> collection; SharpSVNClient.GetInfo(source, out collection); SVNInfo info = SharpSVNToSVNInfo(source, collection); source.SetInfo(info); return info; }
internal static SVNStatus GetStatus(Source source, bool getRemote) { if (source.IsURL) { return null; } Collection<SvnStatusEventArgs> collection = GetStatusCollection(source, getRemote, false); return SharpSVNToSVNStatus(source, collection); }
public static void GetInfo(Source source, out Collection<SvnInfoEventArgs> collection) { using (SvnClient client = GetSvnClient(source)) { SvnInfoArgs args = new SvnInfoArgs { ThrowOnError = true }; client.GetInfo(SvnTarget.FromString(source.Path), args, out collection); } }
public virtual void RunTest() { List<SVNLogEntry> list = new List<SVNLogEntry>(); Source tempLocal0 = new Source { Name = "SVNMonitor" }; Source source = tempLocal0; SVNLogEntry entry = new SVNLogEntry(source, 0x4d2L, "Chuck", DateTime.Now, "Fixed all bugs in the world."); list.Add(entry); EventLog.LogInfo(string.Format("Testing '{0}'...", DisplayName), this); Run(list, null); }
public static void HandleSourceSVNException(Source source, SvnException svnex) { if (source != null) { string message = string.Format("{0}: {1}", source.Name, svnex.Message); Logger.Log.Error(message); if (source.IsAlive) { long errorID = Append(message, source, svnex); source.SetError(message, errorID); } } else { Logger.Log.Error(svnex.ToString()); } }
internal static SVNLog GetLog(Source source, long startRevision) { Collection<SvnLogEventArgs> collection; SharpSVNClient.GetLog(source, startRevision, out collection); SVNLog log = new SVNLog(); if ((collection.Count != 1) || (collection[0].Revision != source.Revision)) { SVNInfo info = GetInfo(source); Collection<SvnStatusEventArgs> statusCollection = null; if (!source.IsURL) { statusCollection = GetStatusCollection(source, false, true); } log = SharpSVNToSVNLog(source, collection, info, statusCollection); } log.Source = source; return log; }
public static void GetLog(Source source, long startRevision, out Collection<SvnLogEventArgs> collection) { SvnLogArgs args = new SvnLogArgs { Limit = ApplicationSettingsManager.Settings.LogEntriesPageSize, ThrowOnError = true }; if (startRevision >= 0L) { args.Start = new SvnRevision(startRevision); args.End = new SvnRevision(SvnRevisionType.Head); } using (SvnClient client = GetSvnClient(source)) { if (source.IsURL) { client.GetLog(new Uri(source.Path), args, out collection); } else { client.GetLog(source.Path, args, out collection); } } }
internal static bool CanCopyUnversionedItems(Source source) { if (source == null) { return false; } return (source.UnversionedCount > 0); }
internal static bool CanCopyPath(Source source) { return ((source != null) && !source.IsURL); }
internal static bool CanCheckout(Source source) { return (source != null); }
internal static bool CanTSVNSettings(Source source) { return true; }
internal static bool CanRevisionGraph(Source source) { return (source != null); }
internal static bool CanBranchTag(Source source) { return ((source != null) && !source.IsURL); }
internal static bool CanTSVNHelp(Source source) { return true; }
internal static bool CanRunWizard(Source source) { return (source != null); }
internal static bool CanCheckForUpdates(Source source) { return (((source != null) && source.Enabled) && !source.Updating); }
internal static bool CanShowSVNLog(Source source) { return (source != null); }
internal static bool CanCleanUp(Source source) { return ((source != null) && !source.IsURL); }
internal static bool CanSVNCheckForModifications(Source source) { return ((source != null) && !source.IsURL); }
internal static bool CanCopyError(Source source) { return ((source != null) && source.HasError); }
internal static bool CanSVNCommit(Source source) { return (ApplicationSettingsManager.Settings.CommitIsAlwaysEnabled || ((source != null) && source.HasLocalChanges)); }
internal static bool CanCopyName(Source source) { return (source != null); }
internal static bool CanSVNRevert(Source source) { return ((source != null) && source.HasLocalVersionedChanges); }
internal static bool CanCopyToClipboard(Source source) { return (source != null); }
internal static bool CanSVNUpdate(Source source) { return ((source != null) && !source.IsURL); }
internal static bool CanCopyURL(Source source) { if (source == null) { return false; } if (!source.IsURL && (source.GetInfo(false) == null)) { return false; } return true; }
internal static bool CanSwitch(Source source) { return ((source != null) && !source.IsURL); }