Error using emacs for commit message on windows.

Asked by amicitas

I am unable to use emacs for commit messages on windows.
When I attempt to do so I get the following error when I try to save the message in emacs:

vc-bzr-registered: IO error reading c:/library/code/python/annotatex/releases/test/.bzr/checkout/dirstate: Permission denied.

Is there a simple way around this? I do not know if this is an emacs or bazaar bug (I suspect a emacs bug).

It seems that I what needs to happen is that emacs should not try to load vc-bzr for commit messages.

Windows
bzr v1.13
emacs v22.3

--amicitas

Here is the full output in the emacs message buffer:
("C:\\Programs\\text\\emacs-22.3\\bin\\emacs.exe" "bzr_log.uguzjb")
Loading encoded-kb...done
Loading font-lock...done
Loading paren...done
For information about GNU Emacs and the GNU system, type C-h C-a.
Loading vc-bzr...done
vc-bzr-registered: IO error reading c:/library/code/python/annotatex/releases/test/.bzr/checkout/dirstate: Permission denied
Auto-saving...done

Question information

Language:
English Edit question
Status:
Solved
For:
Bazaar Edit question
Assignee:
No assignee Edit question
Solved by:
amicitas
Solved:
Last query:
Last reply:
Revision history for this message
Launchpad Janitor (janitor) said :
#1

This question was expired because it remained in the 'Open' state without activity for the last 15 days.

Revision history for this message
Martin Pool (mbp) said :
#2

Hi,

It may be that emacs is failing to read the file because it's already open by bzr. This may be a reflection of bug 99836, or it might be something more specific.

What happens if you just try to open the nominated file at that time, in another copy of emacs or in notepad?

As a (not very good) workaround, you can save the commit message from emacs to a temporary file.

I'm not sure why emacs should be trying to read that file to compose a commit message. Could you try setting debug-on-error and posting the traceback from that?

Revision history for this message
Vincent Ladeuil (vila) said :
#3

Could it be that you're using emacs to commit and that you also set emacs as your commit message editor ?

In that case, and that's specific to windows, you may be running into bug 98836 (as Martin pointed out, with a typo in the bug number), i.e. both emacs try to lock at the same time and the last one failed.

The work around may be to use Notepad, or you may prefer emacsclient (don't forget to start the server with M-x start-server).

Revision history for this message
amicitas (mir-amicitas) said :
#4

I have been in contact with some of the emacs people and we spent some time tracking this down.

The discussion can be found here:
http://emacsbugs.donarmstrong.com/cgi-bin/bugreport.cgi?bug=3122

The gist of it is that emacs tries to read the .bzr directory and cannot handle that .bzr/checkout/dirstate is locked (is a windowsy way) during a commit. It sounds like there is a fix in the works.

Using any editor that doesn't try to be smart about reading the .bzr directory (which is not required to compose a commit message) will work ok here.