Using vim as hg's editor causes "unable to open swapfile" error
Categories
(Firefox Build System :: MozillaBuild, defect, P5)
Tracking
(Not tracked)
People
(Reporter: mhentges, Unassigned)
References
(Regression)
Details
(Keywords: regression)
Attachments
(1 obsolete file)
To reproduce:
- Edit
~/mercurial.ini
, add a line under[ui]
that iseditor = vim
- In some repo, run
hg commit
Workaround
Change the editor
line to be editor = vim -n
so that, when hg
invokes vim
, it won't use a swapfile.
Reporter | ||
Updated•3 years ago
|
Comment 1•3 years ago
|
||
I am experiencing this problem. The stated workaround seems to work for me. I thought I would try looking into the problem a bit to see what is going on, since I don't get this problem normally with vim
.
The file that hg
was trying to use for the commit message in this case was C:\Users\bytesized\AppData\Local\Temp\hg-editor-f4825prx.commit.hg.txt
. If I just run vim C:\Users\bytesized\AppData\Local\Temp\hg-editor-f4825prx.commit.hg.txt
, Process Monitor shows that the swap file used is C:\Users\bytesized\AppData\Local\Temp\hg-editor-f4825prx.commit.hg.txt.swp
. However, when I instead call hg amend -e
, Process Monitor shows what appears to be attempts to use several invalid swap file paths:
C:\Users\bytesized\mozilla-central\.C\Users\BYTESI~1\AppData\Local\Temp\hg-editor-f4825prx.commit.hg.txt.swp
C:\Users\bytesized\tmp\C\Users\BYTESI~1\AppData\Local\Temp\hg-editor-f4825prx.commit.hg.txt.swp
C:\mozilla-build\msys2\var\tmp\C\Users\BYTESI~1\AppData\Local\Temp\hg-editor-f4825prx.commit.hg.txt.swp
C:\mozilla-build\msys2\tmp\C\Users\BYTESI~1\AppData\Local\Temp\hg-editor-f4825prx.commit.hg.txt.swp
I would guess that hg
is giving vim
some directories to use for swap files, and vim
tries to just append the opened file's path to the swap file directory. This sounds like it probably works fine in Linux, but would need special handling in Windows in order to handle the drive name correctly.
Updated•2 years ago
|
Comment 2•1 year ago
|
||
The severity field is not set for this bug.
:ahochheiden, could you have a look please?
For more information, please visit auto_nag documentation.
Updated•1 year ago
|
Updated•7 months ago
|
Description
•