Comment 1 for bug 383098

Revision history for this message
Robert Collins (lifeless) wrote : Re: [Bug 383098] [NEW] search shows non-ascii filenames as HTML-escaped string

On Wed, 2009-06-03 at 09:38 +0000, Alexander Belchenko wrote:
> Public bug reported:
>
> Does `bzr search` supposed to be used from command-line or to produce
> HTML output?

Its meant to be used from the command line. loggerhead uses bzr's API
when generating search results.

> C:\Temp\5>bzr search foo
> bzr: ERROR: No matches were found for the search [u'foo'].

This is very programmatic; perhaps bzr-search should encode into the
output locale here rather than using repr.

> C:\Temp\5>bzr index
>
> C:\Temp\5>bzr search foo
> '#1058;&#1077;&#1089;&#1090;.txt in revision '<email address hidden>'. Summary: 'foo

Oh thats ugly. It's the result of

path = self.index.search((self.text_key,)).next()
return "%s in revision '%s'." % (path.document_name(), self.text_key[1])

It suggests to me that the path was indexed wrongly. Could you perhaps
add some output at line 731 of index.py:
            bar.finished()
+ print repr(terms)
        return terms.iteritems()

I suspect its a bug with the xml fast-pathing in bzr-search's
inventory.py.

I'd be interested if the new codepath for development-rich-root
repositories handles this better.

-Rob

 status confirmed
 importance high