Cannot commit to a mercurial repo

Committing has been working to a repo for about a year, (BTW - I paid for my SourceTree).

All of a sudden, today without warning i cannot commit to the repo because it hangs forever( presumably) with the following text in the window.

hg commit -y -m "added single carrier solutions and no change of airports" metasearch/travelport/src/main/java/com/usingmiles/metasearch/travelport/request/FlightRequestBuilder.java

Vim: Warning: Output is not to a terminal Mecurial

Vim: Warning: Input is not from a terminal

[m[m[0m[H[2J[24;1H"/var/folders/aL/aLTce9+nHTG9cbhrMmmb2E+++TI/-Tmp-/hg-editor-ZAOqzn.txt"

<ar/folders/aL/aLTce9+nHTG9cbhrMmmb2E+++TI/-Tmp-/hg-editor-ZAOqzn.txt" 9L, 413C[3;1HHG: Enter commit message. Lines beginning with 'HG:' are removed.

HG: Leave message empty to abort commit.

HG: --

HG: user: David Buschman <d.buschman@usingmiles.com>

HG: branch 'default'

HG: changed metasearch/travelport/src/main/java/com/usingmiles/metasearch/travel[9;1Hport/request/FlightRequestBuilder.java

HG: changed metasearch/travelport/src/test/java/com/usingmiles/metasearch/travel[11;1Hport/TestHarness.java

[1m[34m~ [13;1H~ [14;1H~ [15;1H~ [16;1H~ [17;1H~ [18;1H~ [19;1H~ [20;1H~ [21;1H~ [22;1H~ [23;1H~ [1;1H

6 answers

Your hg is calling Vim for some reason, presumably to try to edit the commit message, which it should not do because the message is provided on the command line.

Something must have changed in your hg configuration to trigger this, please check your ~/.hgrc first.

I am having the same problem, I have also been using SourceTree for quite a while with no problems. I have made no changes to my .hgrc file which has a mod date of Oct 31, 2011. There isn't anything in my .hgrc which mentions vim either. As a test I removed everything from my .hgrc exect my username and still get the same problem with the following output:

hg commit -y -m "<my message>" <file-list>

Vim: Warning: Output is not to a terminal

Vim: Warning: Input is not from a terminal

[m[m[0m[H[2J[24;1H"/var/folders/54/l74x3zvs7vnc0h8l2h4j1wnm0000gn/T/hg-editor-MxJ4hh.txt"

<r/folders/54/l74x3zvs7vnc0h8l2h4j1wnm0000gn/T/hg-editor-MxJ4hh.txt" 26L, 1250C[1;1H[1m[36m[40m [0m[1m [0m[2;1H[1m[36m[40m

[0mHG: Enter commit message. Lines beginning with 'HG:' are removed.

[1m[36m[40m [0mHG: Leave message empty to abort commit.

[1m[36m[40m [0mHG: --

[1m[36m[40m [0mHG: user: Sef Tarbell <sef.tarbell@bettrlife.com>

[1m[36m[40m [0mHG: branch 'default'

<excerpted>

[37m[40m<ers/54/l74x3zvs7vnc0h8l2h4j1wnm0000gn/T/hg-editor-MxJ4hh.txt 1,0-1 Top[1;3H

If I paste the command from that into a command line it works fine, btw.

Hmm, I'm using SourceTree and hg literally every day - can you tell me what version of Mercurial you're using?

I too have been using SourceTree, with hg fronting SVN repos so I can have local commits( yeah!!!! ). I use it every day ( 10 plus times ) across 4 SVN repos( don't ask :) ).

Neither restarting SourceTree nor rebooting the Laptop had any effect.

The problem is somehow related to the type of change you want to commit to the hg local repo. If I undid the change that was giving me a problem committing and I made a change somewhere else in the code, I could commit the new change without problem, then a couple of days later, I was able to go back and commit the change that was originally giving me the problem. Even

I am wondering if there is a special character or special pattern this is messing up some regex/parsing logic within SourceTree and something in the delta of this specific change set is exposing it.

FYI : I am using ST - 1.3.2, and hg - embedded hg 2.0.1 , on OS I have hg - 1.9.1+20110818 installed

If one of you gets in this state, is it possible you could send me a repro case so I can examine it here?

I can't imagine what would be triggering this behaviour. There's no way that 'hg commit' should be trying to launch the editor (Vim in this case) like this when the commit message is already supplied with the '-m' option. It's actually hg that's trying to launch it, in response to the command, rather than SourceTree, but I can't imagine why, especially since Sef mentioned that if he copied & pasted the command in the SourceTree window into the command line, it worked fine. I really need to see it happening I think - I commit to hg multiple times per day and I've never seen it.

Same thing here. Sorry but I can't provide you with the repo for check it (private work repo). I'm using 1.3.2 but tested also with 1.3.1 (still available thru the web replacing the URL) because my guess was that started failing after the last App Store update.

If you have this problem, and you can't send it to me to reproduce, would you mind trying it with the latest Mercurial from http://mercurial.selenic.com/? After installing it you'll need to go to Preferences > Mercurial and click 'Use System Mercurial'. Since this seems to be specific to some repo state that I can't reproduce I wonder if it might have been fixed in a more recent hg version than is packaged with SourceTree currently. I'm clutching at straws a bit because I have very little to go on right now.

Same behaviour with mercurial-2.1.1+20120301 :(

Can you reproduce this on a separate hg repo that you *can* send to me? I'm completely stuck here without a reproduction case, since none of my hg repos exhibit this behaviour, and my trawling of the hg docs / code has not provided any explanations as to why the '-m' argument might be ignored and the command-line $EDITOR suddenly invoked.

I can't reproduce it on any other repo in the same Mercurial server so seems the repo is screwed someway. I will try to clone it again (different folder to not lose the bad repo for comparation).

Did you find a way to reproduce this? I have the 1.3.3 maintenance release pending but I've been delaying so I could try to fix this issue, but I still have no reproduction case (I still haven't encountered it on any of my hg repos that I use daily).

I have been unable to reproduce this on another repo, and it hasn't happened on the main repo since the day that I reported it (March 10) sorry that I can't be more helpful. It did happen multiple times that day, tho.

@Sef I am tagging onto your post since I cannot answer my own question without "completing" it. :)

I too cannot reproduce this problem since the date I first filed the issue. I have had no problems since. Also I have made no changes to the hgrc file( i.e. extensions ) in many months. So I too am not sure what could be causing this. In my situation, I was able to get around it by undoing the change and commiting another change. Could it be a specific character in the command line that is throw off the command set through SourceTree, where as copy and paste into a terminal window would perform an encoding to fix the problem character. Just a thought.

I'm having the same problem, using version 1.3.2 with Mercurial on a Rails 2.3.14 project. Again, I can't send a repository because it's private work stuff. I get the output below when trying to commit. If I copy the commit command to the terminal, it executes normally and I can then push from SourceTree. Pulling seems to work normally also.

hg commit -y -m "&lt;my message&gt;" &lt;my files&gt; 
Vim: Warning: Output is not to a terminal
Vim: Warning: Input is not from a terminal
[m[0m[33m[47m[1m[24;1H[1m[37m[41mError detected while processing /Users/jwolkerstorfer/.vim/bundle/syntastic/plu[0m[33m[47m[1m

[23;80H[1m[37m[41mg[24;1Hin/syntastic.vim:[0m[33m[47m[1m

[0m[33mline  191:[0m[33m[47m[1m

[1m[37m[41mE319: Sorry, the command is not available in this version:     sign define Synt[0m[33m[47m[1m

[23;80H[1m[37m[41ma[24;1HsticError text=&gt;&gt; texthl=error[0m[33m[47m[1m

[0m[32mPress ENTER or type command to continue

I had three commits in a row with this problem, and it now seems to have resolved itself. The problem first appeared when I tried to commit three lines of SCSS changes in a single file, and after commiting and pushing that file, the problem seems to be gone. I can't see anything out of the ordinary in those lines, but I can safely reproduce them here:

// old code
// in first selector
border: 1px solid black;
background-color: #E6E7EB;
// in second selector
background-color: #E6E7EB;


// new code
// in first selector
border: 1px solid #898995;
background-color: $background_margin;
// in second selector
background-color: $background_margin;

Thanks. I tried using the contents of the text above in a file, adding and committing the 'old code' and then modifying and committing the 'new code'. Both worked without a hitch on 1.3.2 with the embedded hg.

I really, really need someone to send me a repo which is stuck in the broken state, since the the state does appear to be everything. I had someone else report this on email today and am desperately hoping they'll allow me to see their repo.

Playing around with it, I was able to re-create the problem in a trivial test repository that I can share with you. The repository (I've emailed it zipped up to Steve) is in a state where SourceTree is unable to commit the
pending change. Output looks like:

hg commit -y -m test
Vim: Warning: Output is not to a terminal
Vim: Warning: Input is not from a terminal

Here's how I think I broke it (and it's the same thing I did in my
primary project repository before it broke):

I shelved a change.
Then I unshelved it, but I UNCHECKED "delete after applying".

After that is when the commits stop working. I have no idea why, but
I figure this is probably useful information for Atlassian, since you should
now:

a) be able to study the failure with the attached repository
b) be able reproduce from scratch

Thanks so much to Brad for providing a reproduction case for this issue. I've confirmed that the problem appears to be with the state left over by the hgattic extension when you apply a shelved change without deleting it (deleting is the default) - you probably don't have this extension on your command line which is why you didn't see it there. I'll dig into hgattic extension to try to resolve the issue.

If you hit this problem again in the mean time, as a workaround deleting the shelved change that you've applied also resolves the issue.

[Edit]: this is now fixed for 1.3.3 (by changing hgattic's misguided overriding of commit behaviour in this case)

Suggest an answer

Log in or Join to answer
Community showcase
Brian Ganninger
Published Jan 23, 2018 in Sourcetree

Tip from the team: workflow and keyboard shortcuts

Supported Platforms macOS Sourcetree has a lot to offer and, like many developer tools, finding and using it all can be a challenge, especially for a new user. Everyone might not love ...

256 views 0 3
Read article

Atlassian User Groups

Connect with like-minded Atlassian users at free events near you!

Find a group

Connect with like-minded Atlassian users at free events near you!

Find my local user group

Unfortunately there are no AUG chapters near you at the moment.

Start an AUG

You're one step closer to meeting fellow Atlassian users at your local meet up. Learn more about AUGs

Groups near you
Atlassian Team Tour

Join us on the Team Tour

We're bringing product updates and pro tips on teamwork to ten cities around the world.

Save your spot