Cannot commit Mercurial 2.3.1-20120908 fro OS X 10.8

Matt Mackall mpm at selenic.com
Wed Feb 27 00:02:55 UTC 2013


On Tue, 2013-02-26 at 10:36 -0600, Kevin Bullock wrote:
> On Feb 26, 2013, at 5:06 AM, Phil Virgo wrote:
> 
> > I use mercurial on windows - but now trying on Mac from terminal and I am stuck because I cannot commit.   Any help would be appreciated!
> > 
> > 'hg commit'  or 'sudo hg commit' both give the same message  (from TextEdit)
> > 
> > 'The document "hg-editor-i40eg.txt" could not be opened. You don't have permission.'
> 
> It's trying to open it in $TMPDIR, which is usually /var/folders/<random noise>, and is created specially for your user at login (IIUC).
> 
> Try logging out and back in. Failing that, try running "Repair Permissions" in Disk Utility.

The most common problem in this area is:

- Mercurial launches editor on a temp file
- editor detaches and returns 0 immediately at start-up
- Mercurial sees that as editor completion
- Mercurial sees the edit message is unchanged, aborts the ocmmit
- Mercurial deletes the temp file
- editor finally loads up and says "uh, what now?"

A bit of poking at the mailing list archives finds this note from MacHg:

        - Change the default editor to open [TextEdit] via 'open -t -n
        -W'. This fixes
        using the editor under Lion (at least for me) where I was
        getting wierd permission
        problems from opening TextEdit
        via /Applications/TextEdit.app/Contents/MacOS/TextEdit in my
        hgrc file.
        
That 'open' command "opens the default text editor" "in a new instance"
"and waits for exit".
        
https://developer.apple.com/library/mac/#documentation/Darwin/Reference/ManPages/man1/open.1.html
http://mercurial.markmail.org/thread/h42pco6c2aorbs33

-- 
Mathematics is the supreme nostalgia of our time.





More information about the Mercurial mailing list