I just ran into this bug myself, probably for the same reason. It would be nice if the database wasn't locked for the entire bzr operation (like a really long branch or checkout) but instead was only locked for the duration of a transaction. I don't know enough about what kind of things are stored in the database to know if this is feasible in the way bzr-svn is using it, but sqlite itself certainly supports this kind of operation.
But, if it's really a permanent limitation of bzr-svn that it can't ever have two instances using the same repository, I'd suggest that the exception should be caught and a more reasonable error message returned. As is, it is a crash and tells the user to report a bug.
Here is the traceback I got, just in case it is informational:
$ bzr co svn+https://...
bzr: ERROR: pysqlite2.dbapi2.OperationalError: database is locked
Traceback (most recent call last):
File "/usr/lib/python2.4/site-packages/bzrlib/commands.py", line 834, in run_bzr_catch_errors
return run_bzr(argv)
File "/usr/lib/python2.4/site-packages/bzrlib/commands.py", line 790, in run_bzr
ret = run(*run_argv)
File "/usr/lib/python2.4/site-packages/bzrlib/commands.py", line 492, in run_argv_aliases
return self.run(**all_cmd_args)
File "/usr/lib/python2.4/site-packages/bzrlib/builtins.py", line 1012, in run
accelerator_tree, hardlink)
File "/home/wjlanda/.bazaar/plugins/svn/branch.py", line 200, in create_checkout
return self._create_heavyweight_checkout(to_location, revision_id, hardlink=hardlink)
File "/home/wjlanda/.bazaar/plugins/svn/branch.py", line 153, in _create_heavyweight_checkout
checkout_branch.pull(self, stop_revision=revision_id)
File "/usr/lib/python2.4/site-packages/bzrlib/decorators.py", line 165, in write_locked
return unbound(self, *args, **kwargs)
File "/usr/lib/python2.4/site-packages/bzrlib/branch.py", line 1714, in pull
run_hooks=run_hooks)
File "/usr/lib/python2.4/site-packages/bzrlib/decorators.py", line 165, in write_locked
return unbound(self, *args, **kwargs)
File "/usr/lib/python2.4/site-packages/bzrlib/branch.py", line 1513, in pull
self.update_revisions(source, stop_revision, overwrite=overwrite)
File "/usr/lib/python2.4/site-packages/bzrlib/decorators.py", line 165, in write_locked
return unbound(self, *args, **kwargs)
File "/usr/lib/python2.4/site-packages/bzrlib/branch.py", line 1452, in update_revisions
other_last_revno, other_last_revision = other.last_revision_info()
File "/home/wjlanda/.bazaar/plugins/svn/branch.py", line 232, in last_revision_info
last_revid = self.last_revision()
File "/home/wjlanda/.bazaar/plugins/svn/branch.py", line 264, in last_revision
return self.repository.generate_revision_id(last_revnum, self.get_branch_path(last_revnum), self.mapping)
File "/home/wjlanda/.bazaar/plugins/svn/repository.py", line 578, in generate_revision_id
str(mapping.scheme))
File "/home/wjlanda/.bazaar/plugins/svn/revids.py", line 118, in insert_revid
(min_revnum, max_revnum, revid, branch, scheme))
OperationalError: database is locked
bzr 1.3 on python 2.4.5.final.0 (linux2)
arguments: ['/usr/bin/bzr', 'co', 'svn+https://...']
encoding: 'UTF-8', fsenc: 'UTF-8', lang: 'en_US.UTF-8'
plugins:
bisect /home/wjlanda/.bazaar/plugins/bisect [1.1.0pre0]
bzrtools /usr/lib/python2.4/site-packages/bzrlib/plugins/bzrtools [1.3.0]
cvsps /home/wjlanda/.bazaar/plugins/cvsps [unknown]
gtk /usr/lib/python2.4/site-packages/bzrlib/plugins/gtk [0.93.0]
launchpad /usr/lib/python2.4/site-packages/bzrlib/plugins/launchpad [unknown]
loom /home/wjlanda/.bazaar/plugins/loom [1.3.0dev0]
rebase /home/wjlanda/.bazaar/plugins/rebase [0.3.0dev0]
stats /home/wjlanda/.bazaar/plugins/stats [unknown]
svn /home/wjlanda/.bazaar/plugins/svn [0.4.10dev0]
*** Bazaar has encountered an internal error.
Please report a bug at https://bugs.launchpad.net/bzr/+filebug
including this traceback, and a description of what you
were doing when the error occurred.
I just ran into this bug myself, probably for the same reason. It would be nice if the database wasn't locked for the entire bzr operation (like a really long branch or checkout) but instead was only locked for the duration of a transaction. I don't know enough about what kind of things are stored in the database to know if this is feasible in the way bzr-svn is using it, but sqlite itself certainly supports this kind of operation.
But, if it's really a permanent limitation of bzr-svn that it can't ever have two instances using the same repository, I'd suggest that the exception should be caught and a more reasonable error message returned. As is, it is a crash and tells the user to report a bug.
Here is the traceback I got, just in case it is informational:
$ bzr co svn+https://... dbapi2. OperationalErro r: database is locked
bzr: ERROR: pysqlite2.
Traceback (most recent call last): python2. 4/site- packages/ bzrlib/ commands. py", line 834, in run_bzr_ catch_errors python2. 4/site- packages/ bzrlib/ commands. py", line 790, in run_bzr python2. 4/site- packages/ bzrlib/ commands. py", line 492, in run_argv_aliases **all_cmd_ args) python2. 4/site- packages/ bzrlib/ builtins. py", line 1012, in run _tree, hardlink) wjlanda/ .bazaar/ plugins/ svn/branch. py", line 200, in create_checkout heavyweight_ checkout( to_location, revision_id, hardlink=hardlink) wjlanda/ .bazaar/ plugins/ svn/branch. py", line 153, in _create_ heavyweight_ checkout branch. pull(self, stop_revision= revision_ id) python2. 4/site- packages/ bzrlib/ decorators. py", line 165, in write_locked python2. 4/site- packages/ bzrlib/ branch. py", line 1714, in pull hooks=run_ hooks) python2. 4/site- packages/ bzrlib/ decorators. py", line 165, in write_locked python2. 4/site- packages/ bzrlib/ branch. py", line 1513, in pull update_ revisions( source, stop_revision, overwrite= overwrite) python2. 4/site- packages/ bzrlib/ decorators. py", line 165, in write_locked python2. 4/site- packages/ bzrlib/ branch. py", line 1452, in update_revisions last_revno, other_last_revision = other.last_ revision_ info() wjlanda/ .bazaar/ plugins/ svn/branch. py", line 232, in last_revision_info revision( ) wjlanda/ .bazaar/ plugins/ svn/branch. py", line 264, in last_revision .generate_ revision_ id(last_ revnum, self.get_ branch_ path(last_ revnum) , self.mapping) wjlanda/ .bazaar/ plugins/ svn/repository. py", line 578, in generate_ revision_ id mapping. scheme) ) wjlanda/ .bazaar/ plugins/ svn/revids. py", line 118, in insert_revid
File "/usr/lib/
return run_bzr(argv)
File "/usr/lib/
ret = run(*run_argv)
File "/usr/lib/
return self.run(
File "/usr/lib/
accelerator
File "/home/
return self._create_
File "/home/
checkout_
File "/usr/lib/
return unbound(self, *args, **kwargs)
File "/usr/lib/
run_
File "/usr/lib/
return unbound(self, *args, **kwargs)
File "/usr/lib/
self.
File "/usr/lib/
return unbound(self, *args, **kwargs)
File "/usr/lib/
other_
File "/home/
last_revid = self.last_
File "/home/
return self.repository
File "/home/
str(
File "/home/
(min_revnum, max_revnum, revid, branch, scheme))
OperationalError: database is locked
bzr 1.3 on python 2.4.5.final.0 (linux2) /...'] .bazaar/ plugins/ bisect [1.1.0pre0] python2. 4/site- packages/ bzrlib/ plugins/ bzrtools [1.3.0] .bazaar/ plugins/ cvsps [unknown] python2. 4/site- packages/ bzrlib/ plugins/ gtk [0.93.0] python2. 4/site- packages/ bzrlib/ plugins/ launchpad [unknown] .bazaar/ plugins/ loom [1.3.0dev0] .bazaar/ plugins/ rebase [0.3.0dev0] .bazaar/ plugins/ stats [unknown] .bazaar/ plugins/ svn [0.4.10dev0] /bugs.launchpad .net/bzr/ +filebug
arguments: ['/usr/bin/bzr', 'co', 'svn+https:/
encoding: 'UTF-8', fsenc: 'UTF-8', lang: 'en_US.UTF-8'
plugins:
bisect /home/wjlanda/
bzrtools /usr/lib/
cvsps /home/wjlanda/
gtk /usr/lib/
launchpad /usr/lib/
loom /home/wjlanda/
rebase /home/wjlanda/
stats /home/wjlanda/
svn /home/wjlanda/
*** Bazaar has encountered an internal error.
Please report a bug at https:/
including this traceback, and a description of what you
were doing when the error occurred.