[quickbar] avoid unicode decode error which breaks/stops the search

authorAurelien Campeas <aurelien.campeas@logilab.fr>
changeset6f4f61ef3d72
branchdefault
phasepublic
hiddenno
parent revision#ef16b0761a9b fix UnicodeDecodeError, add notes
child revision#d43754c8e5b5 prepare version 1.3.0
files modified by this revision
hgviewlib/qt4/quickbar.py
# HG changeset patch
# User Aurelien Campeas <aurelien.campeas@logilab.fr>
# Date 1305892839 -7200
# Fri May 20 14:00:39 2011 +0200
# Node ID 6f4f61ef3d72b60950b823edf0e7217e221f8f8b
# Parent ef16b0761a9b62aa613c8361ba4f8acae1a5416a
[quickbar] avoid unicode decode error which breaks/stops the search

diff --git a/hgviewlib/qt4/quickbar.py b/hgviewlib/qt4/quickbar.py
@@ -197,11 +197,11 @@
1          graph = self._model.graph
2          idx = graph.index(fromrev)
3          for node in graph[idx:]:
4              rev = node.rev
5              ctx = self._model.repo.changectx(rev)
6 -            if text in ctx.description():
7 +            if text in unicode(ctx.description(), 'utf-8', 'replace'):
8                  yield rev, None
9              pos = 0
10              files = ctx.files()
11              if self._filter_files:
12                  files = [x for x in files if x in self._filter_files]