Kiln » TortoiseHg » TortoiseHg
Clone URL:  
Pushed to one repository · View In Graph Contained in 1.0, 1.0.1, and 1.0.2

commit: give 'new branch' entry a combo box

Closes #763

Changeset 8586d65afe72

Parent c7e212338a38

by Steve Borho

Changes to one file · Browse files at 8586d65afe72 Showing diff from parent c7e212338a38 Diff from another changeset...

 
26
27
28
29
 
30
31
32
 
40
41
42
43
 
44
45
46
47
 
 
48
49
50
 
58
59
60
61
 
 
62
 
 
 
 
 
 
 
63
64
65
 
71
72
73
74
 
75
76
77
 
475
476
477
478
479
480
481
482
 
 
483
484
485
 
26
27
28
 
29
30
31
32
 
40
41
42
 
43
44
45
 
 
46
47
48
49
50
 
58
59
60
 
61
62
63
64
65
66
67
68
69
70
71
72
73
 
79
80
81
 
82
83
84
85
 
483
484
485
 
 
 
 
 
486
487
488
489
490
@@ -26,7 +26,7 @@
 from tortoisehg.hgtk import csinfo, gtklib, thgconfig, gdialog, hgcmd    class BranchOperationDialog(gtk.Dialog): - def __init__(self, branch, close, mergebranches): + def __init__(self, branch, close, repo):   gtk.Dialog.__init__(self, parent=None, flags=gtk.DIALOG_MODAL,   buttons=(gtk.STOCK_OK, gtk.RESPONSE_OK,   gtk.STOCK_CANCEL, gtk.RESPONSE_CANCEL), @@ -40,11 +40,11 @@
  self.newbranch = None   self.closebranch = False   - if mergebranches: + if len(repo.parents()) == 2:   lbl = gtk.Label(_('Select branch of merge commit'))   branchcombo = gtk.combo_box_new_text() - for name in mergebranches: - branchcombo.append_text(name) + for p in repo.parents(): + branchcombo.append_text(p.branch())   branchcombo.set_active(0)   self.vbox.pack_start(lbl, True, True, 2)   self.vbox.pack_start(branchcombo, True, True, 2) @@ -58,8 +58,16 @@
  _('Open a new named branch'))   self.newbranchradio.set_active(True)   self.newbranchradio.connect('toggled', self.nbtoggle) - self.branchentry = gtk.Entry() + branchcombo = gtk.combo_box_entry_new_text() + self.branchentry = branchcombo.child   self.branchentry.connect('activate', self.activated) + + dblist = repo.ui.config('tortoisehg', 'deadbranch', '') + deadbranches = [ x.strip() for x in dblist.split(',') ] + for name in repo.branchtags().keys(): + if name not in deadbranches: + branchcombo.append_text(name) +   self.closebranchradio = gtk.RadioButton(nochanges,   _('Close current named branch'))   @@ -71,7 +79,7 @@
  lbl.set_markup(gtklib.markup(_('Changes take effect on next commit'),   weight='bold'))   table.add_row(lbl, padding=False, ypad=6) - table.add_row(self.newbranchradio, self.branchentry) + table.add_row(self.newbranchradio, branchcombo)   table.add_row(self.closebranchradio)   table.add_row(nochanges)   @@ -475,11 +483,8 @@
  liststore.append([sumline, msg])     def branch_clicked(self, button): - if self.is_merge(): - mb = [p.branch() for p in self.repo.parents()] - else: - mb = None - dialog = BranchOperationDialog(self.nextbranch, self.closebranch, mb) + dialog = BranchOperationDialog(self.nextbranch, + self.closebranch, self.repo)   dialog.run()   self.nextbranch = None   self.closebranch = False