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 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); } }
public void AddLogMessage(LogMessage logMessage) { ListViewItem newItem = new ListViewItem(new string[] { logMessage.Revision.ToString(), logMessage.Author, logMessage.Date.ToString(), logMessage.Message }); newItem.Tag = Revision.FromNumber(logMessage.Revision); leftListView.Items.Add(newItem); ListViewItem newItem2 = new ListViewItem(new string[] { logMessage.Revision.ToString(), logMessage.Author, logMessage.Date.ToString(), logMessage.Message }); newItem2.Tag = Revision.FromNumber(logMessage.Revision); rightListView.Items.Add(newItem2); }