1
votes

Fairly new to Mercurial, I want to perform my initial commit of my personal project. I am working locally on my Ubuntu 12.04 machine.

When I perform the commands:

hg init [folder]
cd [folder]
hg add
hg commit

At the commit something goes wrong and the commit gets aborted. I notice two abnormal things:

  • Mercurial opens but does not wait for exit an empty gedit window, so when I edit the file hg already aborted the commit because the message is empty;
  • gedit pops up with a empty file instead of the usual

    HG: Enter commit message. Lines beginning with 'HG:' are removed. HG: Leave message empty to abort commit. ... etc ...

How do I get this working? Note also that the following command works!

hg commit -m 'initial commit'

My Mercurial configuration file looks like:

# User Interface settings
[ui]
username= Niccolò X <[email protected]>
editor = gedit
merge=meld

# Enabled extensions
[extensions]
hgext.gpg=
hgext.convert=

# GPG extension settings
#[gpg]
#key=<your private gpg key>
1

1 Answers

1
votes

I think that you'll find that the problem only occurs when you already have an instance of gedit open (i.e. pretty much always as that's what you do when you're programming). When you run gedit to edit the commit message, it is telling your currently running gedit instance to load the file and then exiting. The problem with that is that Mercurial assumes that you've done editing the commit message when the editor exits which isn't the case in this instance.

This problem has been discussed on the Mercurial mailing list, here, but the thread didn't come up with a solution to the problem.

This answer implies that setting your editor to gedit --new-window might work but I can't test it myself as I don't use Linux.