public EditRepositoryDialog(Repository editedRepository)
        {
            Build();
            this.repo = editedRepository;

            if (repo != null)
            {
                versionControlType.Sensitive = false;
                versionControlType.AppendText(repo.VersionControlSystem.Name);
                versionControlType.Active = 0;

                editor = repo.VersionControlSystem.CreateRepositoryEditor(repo);
                repoEditorContainer.Add(editor.Widget);
                editor.Widget.Show();
            }
            else
            {
                foreach (VersionControlSystem vcs in VersionControlService.GetVersionControlSystems())
                {
                    if (vcs.IsInstalled)
                    {
                        versionControlType.AppendText(vcs.Name);
                        systems.Add(vcs);
                    }
                }
                versionControlType.Active = 0;
            }
            if (repo != null)
            {
                entryName.Text    = repo.Name;
                repo.NameChanged += OnNameChanged;
            }
        }
        protected void OnInit()
        {
            BazaarVersionControl bvc    = null;
            BazaarRepository     repo   = null;
            VersionControlItem   vcitem = GetItems()[0];
            string          path        = vcitem.Path;
            List <FilePath> addFiles    = null;
            Solution        solution    = (Solution)vcitem.WorkspaceObject;

            foreach (VersionControlSystem vcs in VersionControlService.GetVersionControlSystems())
            {
                if (vcs is BazaarVersionControl)
                {
                    bvc = (BazaarVersionControl)vcs;
                }
            }

            if (null == bvc || !bvc.IsInstalled)
            {
                throw new Exception("Can't use bazaar");
            }

            bvc.Init(path);

            repo     = new BazaarRepository(bvc, string.Format("file://{0}", path));
            addFiles = GetAllFiles(solution);

            repo.Add(addFiles.ToArray(), false, null);
            solution.NeedsReload = true;
        }
Exemplo n.º 3
0
 public void RefreshWorkingRepositories()
 {
     foreach (var system in VersionControlService.GetVersionControlSystems())
     {
         var tfsSystem = system as TFSClient;
         if (tfsSystem != null)
         {
             tfsSystem.RefreshRepositories();
         }
     }
 }
Exemplo n.º 4
0
        public SelectRepositoryDialog(SelectRepositoryMode mode)
        {
            Build();

            GtkWorkarounds.DisableMinimizeMaximizeButtons(this);
            Modal = true;
            foreach (VersionControlSystem vcs in VersionControlService.GetVersionControlSystems())
            {
                if (vcs.IsInstalled)
                {
                    repCombo.AppendText(vcs.Name);
                    systems.Add(vcs);
                }
            }
            repCombo.Active = 0;
            this.mode       = mode;

            store          = new Gtk.TreeStore(typeof(object), typeof(string), typeof(string), typeof(bool), typeof(string));
            repoTree.Model = store;
            TreeViewColumn col = new TreeViewColumn();

            col.Title = GettextCatalog.GetString("Repository");
            CellRendererText  crt = new CellRendererText();
            CellRendererImage crp = new CellRendererImage();

            col.PackStart(crp, false);
            col.PackStart(crt, true);
            col.AddAttribute(crp, "stock-id", IconCol);
            col.AddAttribute(crt, "text", RepoNameCol);
            repoTree.AppendColumn(col);
            repoTree.AppendColumn(GettextCatalog.GetString("Type"), new CellRendererText(), "text", VcsName);
            repoTree.TestExpandRow += new Gtk.TestExpandRowHandler(OnTestExpandRow);
            LoadRepositories();

            if (mode == SelectRepositoryMode.Checkout)
            {
                labelName.Visible    = false;
                entryName.Visible    = false;
                boxMessage.Visible   = false;
                labelMessage.Visible = false;
                defaultPath          = VersionControlDefaultPath;
                entryFolder.Text     = defaultPath;
                buttonOk.Label       = GettextCatalog.GetString("_Checkout");
                UpdateCheckoutButton();
            }
            else
            {
                labelTargetDir.Visible = false;
                boxFolder.Visible      = false;
            }

            repoContainer.SetFlag(WidgetFlags.NoWindow);
            SetupAccessibility();
        }
        /// <summary>
        /// Performs a bzr branch
        /// </summary>
        /// <param name="location">
        /// A <see cref="System.String"/>: The from location
        /// </param>
        /// <param name="localPath">
        /// A <see cref="System.String"/>: The to location
        /// </param>
        /// <param name="monitor">
        /// A <see cref="IProgressMonitor"/>: The progress monitor to be used
        /// </param>
        private static void DoBranch(string location, string localPath, IProgressMonitor monitor)
        {
            BazaarVersionControl bvc = null;

            foreach (VersionControlSystem vcs in VersionControlService.GetVersionControlSystems())
            {
                if (vcs is BazaarVersionControl)
                {
                    bvc = (BazaarVersionControl)vcs;
                }
            }

            if (null == bvc || !bvc.IsInstalled)
            {
                throw new Exception("Bazaar is not installed");
            }

            // Branch
            bvc.Branch(location, localPath, monitor);

            // Search for solution/project file in local branch;
            // open if found
            string[] list = System.IO.Directory.GetFiles(localPath);

            ProjectCheck[] checks =
            {
                delegate(string path)
                {
                    return(path.EndsWith(".mds"));
                },
                delegate(string path)
                {
                    return(path.EndsWith(".mdp"));
                },
                MonoDevelop.Projects.Services.ProjectService.IsWorkspaceItemFile
            };

            foreach (ProjectCheck check in checks)
            {
                foreach (string file in list)
                {
                    if (check(file))
                    {
                        Gtk.Application.Invoke(delegate(object o, EventArgs ea)
                        {
                            IdeApp.Workspace.OpenWorkspaceItem(file);
                        });
                        return;
                    }    // found a project file
                }        // on each file
            }            // run check
        }
        protected override void Update(CommandInfo info)
        {
            BazaarVersionControl bvc = null;

            foreach (VersionControlSystem vcs in VersionControlService.GetVersionControlSystems())
            {
                if (vcs is BazaarVersionControl)
                {
                    bvc = (BazaarVersionControl)vcs;
                }
            }

            info.Visible = (null != bvc && bvc.IsInstalled);
        }
Exemplo n.º 7
0
        public SelectRepositoryDialog(SelectRepositoryMode mode)
        {
            Build();

            foreach (VersionControlSystem vcs in VersionControlService.GetVersionControlSystems())
            {
                if (vcs.IsInstalled)
                {
                    repCombo.AppendText(vcs.Name);
                    systems.Add(vcs);
                }
            }
            repCombo.Active = 0;
            this.mode       = mode;

            store          = new Gtk.TreeStore(typeof(object), typeof(string), typeof(string), typeof(bool), typeof(string));
            repoTree.Model = store;
            TreeViewColumn col = new TreeViewColumn();

            col.Title = GettextCatalog.GetString("Repository");
            CellRendererText   crt = new CellRendererText();
            CellRendererPixbuf crp = new CellRendererPixbuf();

            col.PackStart(crp, false);
            col.PackStart(crt, true);
            col.AddAttribute(crp, "stock-id", IconCol);
            col.AddAttribute(crt, "text", RepoNameCol);
            repoTree.AppendColumn(col);
            repoTree.AppendColumn(GettextCatalog.GetString("Type"), new CellRendererText(), "text", VcsName);
            repoTree.TestExpandRow += new Gtk.TestExpandRowHandler(OnTestExpandRow);
            LoadRepositories();

            if (mode == SelectRepositoryMode.Checkout)
            {
                labelName.Visible    = false;
                entryName.Visible    = false;
                boxMessage.Visible   = false;
                labelMessage.Visible = false;
                defaultPath          = PropertyService.Get("MonoDevelop.Core.Gui.Dialogs.NewProjectDialog.DefaultPath", Environment.GetFolderPath(Environment.SpecialFolder.Personal));
                entryFolder.Text     = defaultPath;
            }
            else
            {
                labelTargetDir.Visible = false;
                boxFolder.Visible      = false;
            }

            repoContainer.SetFlag(WidgetFlags.NoWindow);
        }
Exemplo n.º 8
0
        // TODO: Test rebase and merge - This is broken on Windows

        protected override Repository GetRepo(string path, string url)
        {
            return(new GitRepository(VersionControlService.GetVersionControlSystems().First(id => id.Name == "Git"), path, url));
        }
Exemplo n.º 9
0
 protected override MonoDevelop.VersionControl.Repository GetRepo(string path, string url)
 {
     return(new BazaarRepository((BazaarVersionControl)VersionControlService.GetVersionControlSystems().First(id => id.Name == "Bazaar"), url));
 }