Kiln » TortoiseHg » TortoiseHg
Clone URL:  
Pushed to one repository · View In Graph Contained in tip

stable repofilter, repomodel: fix handling of non-ascii branch name (fixes #1088)

Now HgRepoListModel.setBranch() accepts unicode branch name. Previously
it received both str and unicode and failed to handle unicode.

Changeset dd09a860d097

Parent 36c75e1194f8

by Yuya Nishihara

Changes to 3 files · Browse files at dd09a860d097 Showing diff from parent 36c75e1194f8 Diff from another changeset...

 
9
10
11
 
12
13
14
 
246
247
248
249
250
 
 
 
 
251
252
253
 
9
10
11
12
13
14
15
 
247
248
249
 
 
250
251
252
253
254
255
256
@@ -9,6 +9,7 @@
 from PyQt4.QtCore import *  from PyQt4.QtGui import *   +from tortoisehg.util import hglib  from tortoisehg.hgqt.i18n import _  from tortoisehg.hgqt import revset, qtlib   @@ -246,8 +247,10 @@
  self._branchCombo.clear()   self._branchCombo.addItem(self._allBranchesLabel)   for branch in branches: - self._branchCombo.addItem(branch) - self._branchCombo.setItemData(self._branchCombo.count() - 1, branch, Qt.ToolTipRole) + self._branchCombo.addItem(hglib.tounicode(branch)) + self._branchCombo.setItemData(self._branchCombo.count() - 1, + hglib.tounicode(branch), + Qt.ToolTipRole)   self._branchLabel.setEnabled(self.filterEnabled and (len(branches) > 1 or self._abranchAction.isChecked()))   self._branchCombo.setEnabled(self.filterEnabled and (len(branches) > 1 or self._abranchAction.isChecked()))   self._branchReloading = False
 
123
124
125
126
 
127
128
129
 
 
 
130
131
132
 
 
133
134
135
 
123
124
125
 
126
127
128
 
129
130
131
132
133
 
134
135
136
137
138
@@ -123,13 +123,16 @@
  self.setBranch(branch)     def setBranch(self, branch=None, allparents=True): - self.filterbranch = branch + self.filterbranch = branch # unicode   self.invalidateCache()   if self.revset and self.filterbyrevset: - grapher = revision_grapher(self.repo, branch=branch, revset=self.revset) + grapher = revision_grapher(self.repo, + branch=hglib.fromunicode(branch), + revset=self.revset)   self.graph = Graph(self.repo, grapher, include_mq=False)   else: - grapher = revision_grapher(self.repo, branch=branch, + grapher = revision_grapher(self.repo, + branch=hglib.fromunicode(branch),   allparents=allparents)   self.graph = Graph(self.repo, grapher, include_mq=True)   self.rowcount = 0
 
705
706
707
708
709
710
 
711
712
713
 
705
706
707
 
708
 
709
710
711
712
@@ -705,9 +705,8 @@
  def setupModels(self):   # Filter revision set in case revisions were removed   self.revset = [r for r in self.revset if r < len(self.repo)] - branch = hglib.fromunicode(self.ubranch)   self.repomodel = HgRepoListModel(self.repo, self.repoview.colselect[0], - branch, self.revset, + self.ubranch, self.revset,   self.revsetfilter, self)   self.repomodel.filled.connect(self.modelFilled)   self.repomodel.loaded.connect(self.modelLoaded)