Advertisement
Guest User

Untitled

a guest
Feb 4th, 2013
147
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C# 2.09 KB | None | 0 0
  1. private static void fakeFunction()
  2.         {
  3.             var RootPath = @"d:\";
  4.             var appPath = @"e:\svnversion.exe";
  5.             using (var client = new SharpSvn.SvnClient())
  6.             using (var workingClient = new SvnWorkingCopyClient())
  7.             {
  8.                 SvnWorkingCopyVersion workingVersion = null;
  9.  
  10.                 long wVersion;
  11.                 if (GetVersionHack(appPath, RootPath, out wVersion)
  12.                     /*workingClient.GetVersion(RootPath, out workingVersion)*/)
  13.                 {
  14.                     //var CurrentRevision = workingVersion.End;
  15.                     // This will resolve just fine
  16.                     var targetUri = client.GetUriFromWorkingCopy(RootPath);
  17.                     var target = SvnTarget.FromUri(targetUri);
  18.                     SvnInfoEventArgs info = null;
  19.                     if (client.GetInfo(target, out info))
  20.                     {
  21.                         if (/*workingVersion.End*/wVersion != info.Revision)
  22.                         {
  23.                             System.Collections.ObjectModel.Collection<SvnLogEventArgs> logEventArgs = null;
  24.                             if (client.GetLog(targetUri, out logEventArgs))
  25.                             {
  26.                                 var oldBack = Console.BackgroundColor;
  27.                                 var oldFor = Console.ForegroundColor;
  28.                                 Console.BackgroundColor = ConsoleColor.DarkMagenta;
  29.                                 Console.ForegroundColor = ConsoleColor.White;
  30.                                 foreach (var l in logEventArgs)
  31.                                 {
  32.                                     Console.WriteLine("[{0}-{1}]-{2}", l.Revision, l.Author, l.LogMessage);
  33.                                 }
  34.                                 Console.BackgroundColor = oldBack;
  35.                                 Console.ForegroundColor = oldFor;
  36.                             }
  37.  
  38.                             System.Console.WriteLine("Repo not up to date.");
  39.                         }
  40.                     }
  41.                 }
  42.             }
  43.         }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement