Exemplo n.º 1
0
        private static IEnumerable <SvnItem> GetAllUpdateRoots(CommandEventArgs e)
        {
            // Duplicate handling is handled above this method!
            ISvnSolutionLayout pls = e.GetService <ISvnSolutionLayout>();

            if (IsSolutionCommand(e.Command))
            {
                foreach (SvnItem item in pls.GetUpdateRoots(null))
                {
                    yield return(item);
                }
            }
            else if (IsFolderCommand(e.Command))
            {
                foreach (SvnItem item in e.Selection.GetSelectedSvnItems(false))
                {
                    // Everything is checked in the OnUpdate
                    yield return(item);
                }
            }
            else
            {
                foreach (SccProject project in GetSelectedProjects(e))
                {
                    foreach (SvnItem item in pls.GetUpdateRoots(project))
                    {
                        yield return(item);
                    }
                }
            }
        }
Exemplo n.º 2
0
        void DoRefresh(bool showProgressDialog)
        {
            ISvnSolutionLayout          pls        = Context.GetService <ISvnSolutionLayout>();
            List <SvnStatusEventArgs>   resultList = new List <SvnStatusEventArgs>();
            List <string>               roots      = new List <string>(SvnItem.GetPaths(pls.GetUpdateRoots(null)));
            Dictionary <string, string> found      = new Dictionary <string, string>(StringComparer.OrdinalIgnoreCase);
            bool refreshFromList = false;

            try
            {
                if (showProgressDialog)
                {
                    IProgressRunner pr = Context.GetService <IProgressRunner>();
                    if (pr.RunModal(PCResources.RetrievingRemoteStatus,
                                    delegate(object sender, ProgressWorkerArgs e)
                    {
                        SvnStatusArgs sa = new SvnStatusArgs();
                        sa.RetrieveRemoteStatus = true;
                        DoFetchRecentChanges(e.Client, sa, roots, resultList, found);
                    }).Succeeded)
                    {
                        refreshFromList = true;
                    }
                }
                else
                {
                    ShowBusyIndicator();
                    using (SvnClient client = Context.GetService <ISvnClientPool>().GetClient())
                    {
                        SvnStatusArgs sa = new SvnStatusArgs();
                        sa.RetrieveRemoteStatus = true;
                        // don't throw error
                        // list is cleared in case of an error
                        // show a label in the list view???
                        sa.ThrowOnError = false;
                        DoFetchRecentChanges(client, sa, roots, resultList, found);
                        refreshFromList = true;
                    }
                }
            }
            finally
            {
                if (refreshFromList)
                {
                    OnRecentChangesFetched(resultList);
                }
                if (!showProgressDialog)
                {
                    HideBusyIndicator();
                }
            }
        }