void GetLogMessages( ) { try { string fileName = Path.GetFullPath(_viewContent.FileName); LoggingService.Info("SVN: Get log of " + fileName); if (File.Exists(fileName)) { Client client = SvnClient.Instance.Client; client.Log(new string[] { fileName }, Revision.Head, // Revision start Revision.FromNumber(1), // Revision end false, // bool discoverChangePath false, // bool strictNodeHistory new LogMessageReceiver(ReceiveLogMessage)); } } catch (Exception ex) { // if exceptions aren't caught here, they force SD to exit if (ex is SvnClientException || ex is System.Runtime.InteropServices.SEHException) { LoggingService.Warn(ex); HostServicesSingleton.SafeThreadAsyncCall(_infoPanel.ShowError, ex); } else { MessageService.ShowError(ex); } } }
void OperationDone( ) { if (done) { return; } HostServicesSingleton.SafeThreadCall(WriteMid, "Done"); try { if (inOperationForm != null) { inOperationForm.Operation = null; HostServicesSingleton.SafeThreadCall(inOperationForm.Close); inOperationForm = null; } } catch (Exception e) { MessageService.ShowError(e); } finally { done = true; } }
void LoadChangedPaths(object state) { try { LogMessage logMessage = (LogMessage)loadChangedPathsItem.Tag; string fileName = Path.GetFullPath(_viewContent.FileName); Client client = SvnClient.Instance.Client; try { client.Log(new string[] { fileName }, Revision.FromNumber(logMessage.Revision), // Revision start Revision.FromNumber(logMessage.Revision), // Revision end true, // bool discoverChangePath false, // bool strictNodeHistory new LogMessageReceiver(ReceiveChangedPaths)); } catch (SvnClientException ex) { if (ex.ErrorCode == 160013) { // This can happen when the file was renamed/moved so it cannot be found // directly in the old revision. In that case, we do a full download of // all revisions (so the file can be found in the new revision and svn can // follow back its history). client.Log(new string[] { fileName }, Revision.FromNumber(1), // Revision start Revision.FromNumber(lastRevision), // Revision end true, // bool discoverChangePath false, // bool strictNodeHistory new LogMessageReceiver(ReceiveAllChangedPaths)); } else { throw; } } loadChangedPathsItem = null; isLoadingChangedPaths = false; HostServicesSingleton.SafeThreadAsyncCall <object, EventArgs>(this.RevisionListViewSelectionChanged, null, EventArgs.Empty); } catch (Exception ex) { MessageService.ShowError(ex); } }
private void DoDiffOperation() { output = null; MemoryStream outStream = new MemoryStream(); MemoryStream errStream = new MemoryStream(); SvnClient.Instance.Client.Diff(new string [] {}, fileName, fromRevision, fileName, toRevision, Recurse.None, false, true, outStream, errStream); output = Encoding.Default.GetString(outStream.ToArray()); HostServicesSingleton.SafeThreadCall(SetOutput); }
void ReceiveLogMessage(LogMessage logMessage) { HostServicesSingleton.SafeThreadAsyncCall(_infoPanel.AddLogMessage, logMessage); HostServicesSingleton.SafeThreadAsyncCall(_diffPanel.AddLogMessage, logMessage); }
protected void Callback() { HostServicesSingleton.SafeThreadAsyncCall(CallbackInvoked); }