Merge lp:~weyrick/bzr-search/bzr-search-720853 into lp:bzr-search

Proposed by Shannon Weyrick
Status: Merged
Merged at revision: 94
Proposed branch: lp:~weyrick/bzr-search/bzr-search-720853
Merge into: lp:bzr-search
Diff against target: 28 lines (+4/-1)
1 file modified
index.py (+4/-1)
To merge this branch: bzr merge lp:~weyrick/bzr-search/bzr-search-720853
Reviewer Review Type Date Requested Status
Jelmer Vernooij (community) Approve
Review via email: mp+85747@code.launchpad.net

Description of the change

Skip bad index keys when BadIndexKey fires from btree_index

To post a comment you must log in.
Revision history for this message
Jelmer Vernooij (jelmer) wrote :

Since there is a bug looming here somewhere, I think the error message should be a warning or at least a note rather than mutter, which isn't visible to th user.

The error message shouldn't say that it's skipping a particular key - it's aborting the indexing entirely. It would also be useful to include the key that was problematic, for debugging purposes.

Revision history for this message
Jelmer Vernooij (jelmer) wrote :

and thanks for working on this. I'm voting Needs Fixing for the moment, let me know when I should have another look.

review: Needs Fixing
94. By Shannon Weyrick

Switch to warning, include bad key in message, clarify message

Revision history for this message
Shannon Weyrick (weyrick) wrote :

Jelmer, I've made changes based on your comments. I changed the message to "indexing incomplete" because although it does abort it in some sense, it does end up with a usable (i.e. searchable) index.

Revision history for this message
Jelmer Vernooij (jelmer) wrote :

thanks!

review: Approve

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
=== modified file 'index.py'
--- index.py 2011-11-23 18:20:01 +0000
+++ index.py 2012-01-02 20:58:25 +0000
@@ -23,7 +23,7 @@
23import re23import re
2424
25from bzrlib import branch as _mod_branch25from bzrlib import branch as _mod_branch
26from bzrlib import ui26from bzrlib import (ui, trace)
27from bzrlib.btree_index import BTreeGraphIndex, BTreeBuilder27from bzrlib.btree_index import BTreeGraphIndex, BTreeBuilder
28from bzrlib.bzrdir import BzrDirMeta128from bzrlib.bzrdir import BzrDirMeta1
29import bzrlib.config29import bzrlib.config
@@ -32,6 +32,7 @@
32 NoSuchFile,32 NoSuchFile,
33 UnknownFormatError,33 UnknownFormatError,
34 UnknownSmartMethod,34 UnknownSmartMethod,
35 BadIndexKey,
35 )36 )
36from bzrlib.index import CombinedGraphIndex, GraphIndex, InMemoryGraphIndex37from bzrlib.index import CombinedGraphIndex, GraphIndex, InMemoryGraphIndex
37from bzrlib.lockdir import LockDir38from bzrlib.lockdir import LockDir
@@ -404,6 +405,8 @@
404 builder.add_revision(rev_id)405 builder.add_revision(rev_id)
405 steps.update("Saving group", 3, 4)406 steps.update("Saving group", 3, 4)
406 self._add_index(builder)407 self._add_index(builder)
408 except BadIndexKey as bKey:
409 trace.warning("%s, indexing incomplete" % str(bKey))
407 finally:410 finally:
408 steps.finished()411 steps.finished()
409412

Subscribers

People subscribed via source and target branches

to all changes: