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
1=== modified file 'index.py'
2--- index.py 2011-11-23 18:20:01 +0000
3+++ index.py 2012-01-02 20:58:25 +0000
4@@ -23,7 +23,7 @@
5 import re
6
7 from bzrlib import branch as _mod_branch
8-from bzrlib import ui
9+from bzrlib import (ui, trace)
10 from bzrlib.btree_index import BTreeGraphIndex, BTreeBuilder
11 from bzrlib.bzrdir import BzrDirMeta1
12 import bzrlib.config
13@@ -32,6 +32,7 @@
14 NoSuchFile,
15 UnknownFormatError,
16 UnknownSmartMethod,
17+ BadIndexKey,
18 )
19 from bzrlib.index import CombinedGraphIndex, GraphIndex, InMemoryGraphIndex
20 from bzrlib.lockdir import LockDir
21@@ -404,6 +405,8 @@
22 builder.add_revision(rev_id)
23 steps.update("Saving group", 3, 4)
24 self._add_index(builder)
25+ except BadIndexKey as bKey:
26+ trace.warning("%s, indexing incomplete" % str(bKey))
27 finally:
28 steps.finished()
29

Subscribers

People subscribed via source and target branches

to all changes: