NotifyAfterCommit() static private method

static private NotifyAfterCommit ( Repository repo, MonoDevelop.VersionControl.ChangeSet changeSet, bool success ) : void
repo Repository
changeSet MonoDevelop.VersionControl.ChangeSet
success bool
return void
Esempio n. 1
0
            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);
                }
            }
Esempio n. 2
0
 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);
     }
 }
Esempio n. 3
0
        public static void Commit(Repository vc, ChangeSet changeSet)
        {
            try {
                if (vc.GetVersionInfo(changeSet.BaseLocalPath).CanCommit)
                {
                    if (!VersionControlService.NotifyPrepareCommit(vc, changeSet))
                    {
                        return;
                    }

                    CommitDialog dlg = new CommitDialog(changeSet);
                    try {
                        if (MessageService.RunCustomDialog(dlg) == (int)Gtk.ResponseType.Ok)
                        {
                            if (VersionControlService.NotifyBeforeCommit(vc, changeSet))
                            {
                                new CommitWorker(vc, changeSet, dlg).Start();
                                return;
                            }
                        }
                        dlg.EndCommit(false);
                    } finally {
                        dlg.Destroy();
                    }
                    VersionControlService.NotifyAfterCommit(vc, changeSet, false);
                }
            }
            catch (Exception ex) {
                MessageService.ShowException(ex, GettextCatalog.GetString("Version control command failed."));
            }
        }
Esempio n. 4
0
        public static bool Commit(Repository vc, ChangeSet changeSet, bool test)
        {
            try
            {
                if (changeSet.IsEmpty)
                {
                    if (!test)
                    {
                        MessageService.ShowMessage(GettextCatalog.GetString("There are no changes to be committed."));
                    }
                    return(false);
                }

                if (vc.GetVersionInfo(changeSet.BaseLocalPath).CanCommit)
                {
                    if (test)
                    {
                        return(true);
                    }

                    if (!VersionControlService.NotifyPrepareCommit(vc, changeSet))
                    {
                        return(false);
                    }
                    CommitDialog dlg = new CommitDialog(changeSet);
                    try
                    {
                        if (MessageService.RunCustomDialog(dlg) == (int)Gtk.ResponseType.Ok)
                        {
                            if (VersionControlService.NotifyBeforeCommit(vc, changeSet))
                            {
                                new CommitWorker(vc, changeSet, dlg).Start();
                                return(true);
                            }
                        }
                        dlg.EndCommit(false);
                    }
                    finally
                    {
                        dlg.Destroy();
                    }
                    VersionControlService.NotifyAfterCommit(vc, changeSet, false);
                }
                return(false);
            }
            catch (Exception ex)
            {
                if (test)
                {
                    LoggingService.LogError(ex.ToString());
                }
                else
                {
                    MessageService.ShowException(ex, GettextCatalog.GetString("Version control command failed."));
                }
                return(false);
            }
        }
Esempio n. 5
0
            protected override void Finished()
            {
                dlg.EndCommit(success);
                dlg.Destroy();
                FileUpdateEventArgs args = new FileUpdateEventArgs();

                foreach (ChangeSetItem it in changeSet.Items)
                {
                    args.Add(new FileUpdateEventInfo(vc, it.LocalPath, it.IsDirectory));
                }

                if (args.Count > 0)
                {
                    VersionControlService.NotifyFileStatusChanged(args);
                }

                VersionControlService.NotifyAfterCommit(vc, changeSet, success);
            }