void FillBranches() { TreeViewState state = new TreeViewState(listBranches, 3); state.Save(); storeBranches.Clear(); string currentBranch = repo.GetCurrentBranch(); foreach (var branch in repo.GetBranches()) { string text = branch.Name == currentBranch ? "<b>" + branch.Name + "</b>" : branch.Name; storeBranches.AppendValues(branch, text, true /*branch.Tracking*/, branch.Name); } state.Load(); }
protected override void Update(CommandArrayInfo info) { MercurialRepository repo = Repository; if (repo != null) { string currentBranch = repo.GetCurrentBranch(); foreach (var branch in repo.GetBranches()) { CommandInfo ci = info.Add(branch.Name, branch.Name); if (branch.Name == currentBranch) { ci.Checked = true; } } } }
public override void BuildNode(ITreeBuilder treeBuilder, object dataObject, ref string label, ref Gdk.Pixbuf icon, ref Gdk.Pixbuf closedIcon) { IWorkspaceObject ob = (IWorkspaceObject)dataObject; MercurialRepository rep = VersionControlService.GetRepository(ob) as MercurialRepository; if (rep != null) { IWorkspaceObject rob; if (repos.TryGetValue(rep.RootPath.CanonicalPath, out rob)) { if (ob == rob) { label += " (" + rep.GetCurrentBranch() + ")"; } } } }
void UpdateRemoteBranches() { ((Gtk.ListStore)branchCombo.Model).Clear(); if (remoteCombo.Active == -1) { branchCombo.Sensitive = false; return; } branchCombo.Sensitive = true; var list = new List <string> (repo.GetRemoteBranches(remoteCombo.ActiveText)); foreach (string s in list) { branchCombo.AppendText(s); } branchCombo.Active = list.IndexOf(repo.GetCurrentBranch()); }
void UpdateStatus() { if (currentSel != null) { string cb = repo.GetCurrentBranch(); string txt = null; if (rebasing) { switch (currentType) { case "branch": txt = GettextCatalog.GetString("The branch <b>{1}</b> will be rebased to the branch <b>{0}</b>.", currentSel, cb); break; case "tag": txt = GettextCatalog.GetString("The branch <b>{1}</b> witl be rebased to the tag <b>{0}</b>.", currentSel, cb); break; case "remote": txt = GettextCatalog.GetString("The branch <b>{1}</b> will be rebased to the remote branch <b>{0}</b>.", currentSel, cb); break; } } else { switch (currentType) { case "branch": txt = GettextCatalog.GetString("The branch <b>{0}</b> will be merged into the branch <b>{1}</b>.", currentSel, cb); break; case "tag": txt = GettextCatalog.GetString("The tag <b>{0}</b> will be merged into the branch <b>{1}</b>.", currentSel, cb); break; case "remote": txt = GettextCatalog.GetString("The remote branch <b>{0}</b> will be merged into the branch <b>{1}</b>.", currentSel, cb); break; } } labelOper.Visible = true; labelOper.Markup = txt; buttonOk.Sensitive = true; } else { labelOper.Visible = false; buttonOk.Sensitive = false; } }