Open Bug 1748761 Opened 3 years ago Updated 7 months ago

Using vim as hg's editor causes "unable to open swapfile" error

Categories

(Firefox Build System :: MozillaBuild, defect, P5)

defect

Tracking

(Not tracked)

People

(Reporter: mhentges, Unassigned)

References

(Regression)

Details

(Keywords: regression)

Attachments

(1 obsolete file)

Upstream bug here.

To reproduce:

  1. Edit ~/mercurial.ini, add a line under [ui] that is editor = vim
  2. 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.

Regressed by: 1725895
Priority: -- → P5

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.

Product: mozilla.org → Firefox Build System

The severity field is not set for this bug.
:ahochheiden, could you have a look please?

For more information, please visit auto_nag documentation.

Flags: needinfo?(ahochheiden)
Keywords: regression
Severity: -- → S4
Flags: needinfo?(ahochheiden)
Attachment #9386458 - Attachment is obsolete: true
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Creator:
Created:
Updated:
Size: