Kiln » TortoiseHg » TortoiseHg
Clone URL:  
Pushed to one repository · View In Graph Contained in 1.9, 1.9.1, and 1.9.2

workbench: update branch combo

according to current repo tab

Changeset 72d7bfbacb3d

Parent f6ce44d39c91

by Adrian Buehlmann

Changes to one file · Browse files at 72d7bfbacb3d Showing diff from parent f6ce44d39c91 Diff from another changeset...

 
111
112
113
114
115
116
117
 
118
119
120
 
125
126
127
128
 
 
 
 
 
 
 
 
 
129
130
131
132
 
133
134
135
 
140
141
142
 
143
144
145
 
111
112
113
 
 
 
 
114
115
116
117
 
122
123
124
 
125
126
127
128
129
130
131
132
133
134
135
136
 
137
138
139
140
 
145
146
147
148
149
150
151
@@ -111,10 +111,7 @@
    def repoTabChanged(self, index=0):   print "repoTabChanged(%i)" % index - w = self.repoTabsWidget.currentWidget() - if w: - # TODO: update toolbars - pass + self.setupBranchCombo()     def addRepoTab(self, repo, fromhead=None):   '''opens the given repo in a new tab''' @@ -125,11 +122,19 @@
  tw.setCurrentIndex(index)     def setupBranchCombo(self, *args): - allbranches = sorted(self.repo.branchtags().items()) + w = self.repoTabsWidget.currentWidget() + if not w: + self.branch_label_action.setEnabled(False) + self.branch_comboBox_action.setEnabled(False) + self.branch_comboBox.clear() + return + + repo = w.repo + allbranches = sorted(repo.branchtags().items())   if self._closed_branch_supp:   openbr = []   for branch, brnode in allbranches: - openbr.extend(self.repo.branchheads(branch, closed=False)) + openbr.extend(repo.branchheads(branch, closed=False))   clbranches = [br for br, node in allbranches if node not in openbr]   branches = [br for br, node in allbranches if node in openbr]   if self.branch_checkBox_action.isChecked(): @@ -140,6 +145,7 @@
  if len(branches) == 1:   self.branch_label_action.setEnabled(False)   self.branch_comboBox_action.setEnabled(False) + self.branch_comboBox.clear()   else:   self.branchesmodel = QtGui.QStringListModel([''] + branches)   self.branch_comboBox.setModel(self.branchesmodel)