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