Пример #1
0
        /// <summary>
        /// Adds the current RepositoryUrl to the recent repositories list.
        /// Builds the RepositoryOverview
        /// This method has to be called from the main thread.
        /// </summary>
        void MakeTreeAndUpdateRepoUrl(SubversionSearcher subversionSearcher, string repoUrl)
        {
            if (SubversionSearcher.IsReady(subversionSearcher))
            {
                string repositoryUrlcp = repoUrl;

                try
                {
                    string newHeadNodePath = subversionSearcher.GetLowestExistingHeadNodePath(repoUrl, subversionSearcher.HeadRevision);
                    HeadNodePath    = newHeadNodePath;
                    repositoryUrlcp = Utils.JoinPaths(subversionSearcher.RepositoryUrl, newHeadNodePath);

                    RepositoryOverview.BuildRepositoryOverview(subversionSearcher, HeadNodePath, subversionSearcher.HeadRevision);
                }
                catch (Exception ex)
                {
                    Progress.ErrorLog(ex);
                    MessageBox.Show(String.Format("Error: {0}", ex.Message));
                }

                if (RecentRepositories.Contains(repositoryUrlcp))
                {
                    RecentRepositories.Remove(repositoryUrlcp);
                }

                RecentRepositories.Insert(0, repositoryUrlcp);
                while (RecentRepositories.Count > Settings.Instance.RepositoryHistoryLength)
                {
                    RecentRepositories.RemoveAt(RecentRepositories.Count - 1);
                }

                RaisePropertyChanged("RecentRepositories");

                Settings.Instance.RecentRepositories = RecentRepositories.ToList();
                Settings.Instance.RepositoryUrl      = repositoryUrlcp;

                RepositoryUrl = repositoryUrlcp;

                if (subversionSearcher.InSearch)
                {
                    Progress.Log("Building repository overview..");
                    TreeRevision = subversionSearcher.HeadRevision;
                    RepositoryOverview.BuildRepositoryOverview(subversionSearcher, HeadNodePath, TreeRevision);
                    Progress.Log("Ready");
                }
            }
        }
Пример #2
0
 /// <summary>
 /// Switches tree root to path at revision
 /// </summary>
 /// <param name="path"></param>
 /// <param name="revision"></param>
 public void SwitchTreeRoot(string path, long revision)
 {
     RepositoryOverview.BuildRepositoryOverview(subversionSearcher, path, revision);
     HeadNodePath  = path;
     RepositoryUrl = subversionSearcher.RepositoryUrl + path;
 }