"bzr commit" fails when BZR_EDITOR is emacsclient
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
Bazaar |
Fix Released
|
Medium
|
Vincent Ladeuil | ||
GNU Emacs |
Invalid
|
Undecided
|
Unassigned |
Bug Description
When committing from Windows, "bzr commit" fails if EDITOR or BZR_EDITOR point to emacsclient. This happens because msgeditor.py creates the temporary log file in the directory where "bzr ci" is invoked, which is normally inside the branch. When you save the log message inside Emacs, Emacs runs "bzr status", because the log message file is in a versioned directory, and Emacs tries to get its revision and status, to show that in the modeline. But because "bzr ci" is still running, the branch is locked, and "bzr status" fails, this failing the commit.
John Arbash Meinel <email address hidden> suggested a simple patch below, which causes the log message file to be created in a temporary directory, outside of the branch. I'm running with it since January, and it works perfectly.
Is it possible to make this part of a future Bazaar release, please?
--- bzrlib/
+++ bzrlib/msgeditor.py 2010-09-29 21:29:15.678375000 +0200
@@ -225,9 +225,9 @@
"""
import tempfile
tmp_fileno, msgfilename = tempfile.
- dir='.',
+# dir='.',
- msgfilename = osutils.
+# msgfilename = osutils.
msgfile = os.fdopen(
try:
if start_message is not None:
Related branches
- John A Meinel: Approve
-
Diff: 76 lines (+19/-15)3 files modifiedbzrlib/msgeditor.py (+9/-12)
bzrlib/tests/test_msgeditor.py (+6/-3)
doc/en/release-notes/bzr-2.3.txt (+4/-0)
Changed in bzr: | |
milestone: | none → 2.3b4 |
Changed in bzr: | |
status: | In Progress → Fix Released |
Thanks for the detailed analysis, yes, the proposed patch sounds like a good plan, I'll make a merge proposal for it.
I use dvc, so I've never encountered the problem. If I want to reproduce it, will disabling dvc be enough or do you have some additional setup (in addition to setting EDITOR to emacsclient) ?