public static async Task CommitAsync(Repository vc, ChangeSet changeSet) { try { VersionControlService.NotifyPrepareCommit(vc, changeSet); if (!await VerifyUnsavedChangesAsync(changeSet)) { return; } CommitDialog dlg = new CommitDialog(changeSet); try { if (MessageService.RunCustomDialog(dlg) == (int)Gtk.ResponseType.Ok) { VersionControlService.NotifyBeforeCommit(vc, changeSet); new CommitWorker(vc, changeSet, dlg).StartAsync(); return; } dlg.EndCommit(false); } finally { dlg.Destroy(); dlg.Dispose(); } VersionControlService.NotifyAfterCommit(vc, changeSet, false); } catch (Exception ex) { MessageService.ShowError(GettextCatalog.GetString("Version control command failed."), ex); } }
protected override void Finished() { dlg.EndCommit(success); dlg.Dispose(); VersionControlService.NotifyAfterCommit(vc, changeSet, success); ArrayList dirs = new ArrayList(); ArrayList files = new ArrayList(); foreach (ChangeSetItem it in changeSet.Items) { if (it.IsDirectory) { dirs.Add(it.LocalPath); } else { files.Add(it.LocalPath); } } foreach (FilePath path in dirs) { VersionControlService.NotifyFileStatusChanged(vc, path, true); } foreach (FilePath path in files) { VersionControlService.NotifyFileStatusChanged(vc, path, false); } }