Bazaar dirstate locking

Ben Finney ben+bazaar at benfinney.id.au
Mon May 17 01:17:37 BST 2010


Eli Zaretskii <eliz at gnu.org> writes:

> > I don't understand why bzr is involved at all when you are editing
> > the commit message
>
> Because I invoke "bzr commit" from outside Emacs, and edit the message
> when it pops via emacsclient.

That's perfectly fine, but you bear the cost of having the message-edit
time *within* the transaction of the “commit”. (For me, that's an
acceptable cost and I usually do it that way.)

If you want to shift that time outside the transaction, Stephen gave an
alternative workflow: edit the message, save it to a file (e.g.
‘bzrcommit’), *then* invoke commit as ‘bzr commit --file "bzrcommit"’.

> >  > I especially don't see why it needs to be locked for readers,
> >  > such as "bzr status" and "bzr log".
> > 
> > Huh?  For the same reason you always lock a database when writing to
> > it: it's inconsistent until you're done.
>
> When writing to the database, yes. But why is it locked while bzr is
> waiting for emacsclient to return?

Because the “commit” transaction has already begun. The database is
locked until that transaction completes.

-- 
 \                    “It's all in the mind, you know.” —The Goon Show |
  `\                                                                   |
_o__)                                                                  |
Ben Finney




More information about the bazaar mailing list