Kiln » TortoiseHg » TortoiseHg
Clone URL:  
Pushed to one repository · View In Graph Contained in 2.0, 2.0.1, and 2.0.2

stable qqueue: use repo.thgactivemqname to fix UnicodeDecodeError

UnicodeDecodeError is raised by q.endswith(activestr), where q is local str
but activestr is unicode.

Changeset 95a083e5da73

Parent de5e842b93aa

by Yuya Nishihara

Changes to one file · Browse files at 95a083e5da73 Showing diff from parent de5e842b93aa Diff from another changeset...

 
35
36
37
38
39
40
41
 
143
144
145
146
147
 
 
 
148
149
150
 
174
175
176
 
177
178
179
 
197
198
199
200
201
 
202
203
204
205
206
207
 
214
215
216
217
 
218
219
220
 
238
239
240
241
 
242
243
244
 
35
36
37
 
38
39
40
 
142
143
144
 
 
145
146
147
148
149
150
 
174
175
176
177
178
179
180
 
198
199
200
 
 
201
202
 
 
203
204
205
 
212
213
214
 
215
216
217
218
 
236
237
238
 
239
240
241
242
@@ -35,7 +35,6 @@
  self.setWindowFlags(self.windowFlags()   & ~Qt.WindowContextHelpButtonHint)   - self.activequeue = ''   self.repo = repo   repo.repositoryChanged.connect(self.reload)   @@ -143,8 +142,9 @@
  if state:   if self.ql.currentRow() != -1:   q = hglib.fromunicode(self.ql.item(self.ql.currentRow()).text()) - self.btact.setEnabled(q != self.activequeue) - self.btren.setEnabled(q == self.activequeue and q != 'patches') + self.btact.setEnabled(q != self.repo.thgactivemqname) + self.btren.setEnabled(q == self.repo.thgactivemqname + and q != 'patches')   self.btdel.setEnabled(q != 'patches')   self.btpur.setEnabled(q != 'patches')   else: @@ -174,6 +174,7 @@
  @pyqtSlot()   def reload(self):   _ui = uimod.ui() + _ui.quiet = True # don't append "(active)"   _ui.pushbuffer()   try:   opts = {'list': True} @@ -197,11 +198,8 @@
  self.itemfont = item.font()   self.itemfontbold = self.itemfont   self.itemfontbold.setBold(True) - activestr = _(' (active)') # locale safe ? (see also mq.py) - if q.endswith(activestr): + if q == self.repo.thgactivemqname:   row_activeq = i - self.activequeue = q[:-len(activestr)] - item.setText(self.activequeue)   item.setFont(self.itemfontbold)   self.ql.setCurrentRow(row_activeq)   @@ -214,7 +212,7 @@
  q = hglib.fromunicode(self.ql.item(currow).text())   self.pl.clear()   patches = [] - if q == self.activequeue: + if q == self.repo.thgactivemqname:   patches = self.repo.mq.full_series   else:   if q == 'patches': @@ -238,7 +236,7 @@
  def qqueueActivate(self):   uq = self.ql.item(self.ql.currentRow()).text()   q = hglib.fromunicode(uq) - if q == self.activequeue: + if q == self.repo.thgactivemqname:   return   if qtlib.QuestionMsgBox(_('Confirm patch queue switch'),   _("Do you really want to activate patch queue '%s' ?") % uq,