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);
         }
     }
 }
Beispiel #2
0
 internal static bool CanCopyConflictedItems(Source source)
 {
     if (source == null)
     {
         return false;
     }
     return (source.PossibleConflictedFilePathsCount > 0);
 }
Beispiel #3
0
 internal static bool CanCopyModifiedItems(Source source)
 {
     if (source == null)
     {
         return false;
     }
     return (source.ModifiedCount > 0);
 }
Beispiel #4
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;
 }
Beispiel #5
0
 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);
     }
 }
Beispiel #7
0
 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);
 }
Beispiel #8
0
 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());
     }
 }
Beispiel #9
0
 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);
         }
     }
 }
Beispiel #11
0
 internal static bool CanCopyUnversionedItems(Source source)
 {
     if (source == null)
     {
         return false;
     }
     return (source.UnversionedCount > 0);
 }
Beispiel #12
0
 internal static bool CanCopyPath(Source source)
 {
     return ((source != null) && !source.IsURL);
 }
Beispiel #13
0
 internal static bool CanCheckout(Source source)
 {
     return (source != null);
 }
Beispiel #14
0
 internal static bool CanTSVNSettings(Source source)
 {
     return true;
 }
Beispiel #15
0
 internal static bool CanRevisionGraph(Source source)
 {
     return (source != null);
 }
Beispiel #16
0
 internal static bool CanBranchTag(Source source)
 {
     return ((source != null) && !source.IsURL);
 }
Beispiel #17
0
 internal static bool CanTSVNHelp(Source source)
 {
     return true;
 }
Beispiel #18
0
 internal static bool CanRunWizard(Source source)
 {
     return (source != null);
 }
Beispiel #19
0
 internal static bool CanCheckForUpdates(Source source)
 {
     return (((source != null) && source.Enabled) && !source.Updating);
 }
Beispiel #20
0
 internal static bool CanShowSVNLog(Source source)
 {
     return (source != null);
 }
Beispiel #21
0
 internal static bool CanCleanUp(Source source)
 {
     return ((source != null) && !source.IsURL);
 }
Beispiel #22
0
 internal static bool CanSVNCheckForModifications(Source source)
 {
     return ((source != null) && !source.IsURL);
 }
Beispiel #23
0
 internal static bool CanCopyError(Source source)
 {
     return ((source != null) && source.HasError);
 }
Beispiel #24
0
 internal static bool CanSVNCommit(Source source)
 {
     return (ApplicationSettingsManager.Settings.CommitIsAlwaysEnabled || ((source != null) && source.HasLocalChanges));
 }
Beispiel #25
0
 internal static bool CanCopyName(Source source)
 {
     return (source != null);
 }
Beispiel #26
0
 internal static bool CanSVNRevert(Source source)
 {
     return ((source != null) && source.HasLocalVersionedChanges);
 }
Beispiel #27
0
 internal static bool CanCopyToClipboard(Source source)
 {
     return (source != null);
 }
Beispiel #28
0
 internal static bool CanSVNUpdate(Source source)
 {
     return ((source != null) && !source.IsURL);
 }
Beispiel #29
0
 internal static bool CanCopyURL(Source source)
 {
     if (source == null)
     {
         return false;
     }
     if (!source.IsURL && (source.GetInfo(false) == null))
     {
         return false;
     }
     return true;
 }
Beispiel #30
0
 internal static bool CanSwitch(Source source)
 {
     return ((source != null) && !source.IsURL);
 }