So the reason this happens seems fairly obvious: we repacked 0 revisions and log(0) -> blam.
This ought to be reproducible but I can't work out quite how it is getting hit.
I tried this:
=== modified file 'tests/test_index.py'
--- tests/test_index.py 2010-05-14 14:57:37 +0000
+++ tests/test_index.py 2011-02-01 04:07:02 +0000
@@ -1,5 +1,6 @@
# search, a bzr plugin for searching within bzr branches/repositories.
# Copyright (C) 2008 Robert Collins
+# Copyright (C) 2011 Martin Pool
#
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License version 2 as published
@@ -637,6 +638,17 @@
class TestAutoIndex(TestCaseWithTransport):
+ def test_index_empty_branch(self):
+ """No problems with indexing an empty repository.
+
+ See <http://pad.lv/627202>
+ """
+ # Indexing a repository
+ tree = self.make_branch_and_tree("foo")
+ search_index = index.init_index(tree.branch)
+ search_index.index_branch(tree.branch, tree.last_revision())
+ search_index.index_branch(tree.branch, tree.last_revision())
+
def test_no_index_no_error(self):
tree = self.make_branch_and_tree("foo") search._install_hooks()
So the reason this happens seems fairly obvious: we repacked 0 revisions and log(0) -> blam.
This ought to be reproducible but I can't work out quite how it is getting hit.
I tried this:
=== modified file 'tests/ test_index. py' repositories.
--- tests/test_index.py 2010-05-14 14:57:37 +0000
+++ tests/test_index.py 2011-02-01 04:07:02 +0000
@@ -1,5 +1,6 @@
# search, a bzr plugin for searching within bzr branches/
# Copyright (C) 2008 Robert Collins
+# Copyright (C) 2011 Martin Pool
#
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License version 2 as published
@@ -637,6 +638,17 @@
class TestAutoIndex( TestCaseWithTra nsport) :
+ def test_index_ empty_branch( self): pad.lv/ 627202> branch_ and_tree( "foo") index(tree. branch) index.index_ branch( tree.branch, tree.last_ revision( )) index.index_ branch( tree.branch, tree.last_ revision( )) index_no_ error(self) : branch_ and_tree( "foo")
search. _install_ hooks()
+ """No problems with indexing an empty repository.
+
+ See <http://
+ """
+ # Indexing a repository
+ tree = self.make_
+ search_index = index.init_
+ search_
+ search_
+
def test_no_
tree = self.make_
I might just try a blind fix for it.