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