Create
cancel
Showing results for 
Search instead for 
Did you mean: 
Sign up Log in

hg shelve: option --git not recognized

incidentist February 28, 2012

This is running SourceTree 1.3.2 with packaged Mercurial 2.0.1.

Steps to reproduce:

1. Make some changes in a repo

2. Click "Shelve" in SourceTree and enter a shelf name. Click OK.

What should happen: Changes should be shelved.

What happens: the following error appears:

hg shelve -y --git --force myShelfName 
hg shelve [OPTION]... [FILE]...

interactively select changes to set aside

options:

 -A --addremove           mark new/missing files as added/removed before
                          shelving
 -f --force               overwrite existing shelve data
 -a --append              append to existing shelve data
    --all                 shelve all changes
 -n --name VALUE          shelve changes to specified shelf name
 -l --list                list active shelves
 -I --include PATTERN [+] include names matching the given patterns
 -X --exclude PATTERN [+] exclude names matching the given patterns

[+] marked option can be specified multiple times

use "hg help shelve" to show the full help text
hg shelve: option --git not recognized
Completed with errors, see above

2 answers

1 accepted

0 votes
Answer accepted
stevestreeting
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Leaders.
February 28, 2012

I can't reproduce this. Please see this video: http://screencast.com/t/Fi8WUVqqLjD Note that in this case I have the 'Show full console output' option checked in Preferences so that you can see the command line even though it succeeds.

This is with the stock 1.3.2, embedded Mercurial, embedded Shelve extension. Have you enabled any other extensions in Preferences > Mercurial?

incidentist February 28, 2012

It's some sort of conflict with my system mercurial. I've used mercurial for a year, and had the shelve extension installed. When I remove the shelve extension line from my .hgrc, shelving works in SourceTree.

I still think this is a bug. When the shelve line is uncommented, the shelve extension appears in the Extensions list in SourceTree preferences. The box next to it is unchecked, meaning it is disabled, so I'm not sure why it's using my system shelve extension rather than the SourceTree shelve extension.

stevestreeting
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Leaders.
February 29, 2012

Yes, not overriding your system extension is a bug. Logged here: https://jira.atlassian.com/browse/SRCTREE-913

SourceTree actually uses the 'hgattic' extension, not the 'hgshelve' extension, because it's more flexible. I updated this myself to the latest hg, you can get it here if you like https://bitbucket.org/sinbad/hgattic/overview

stevestreeting
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Leaders.
March 4, 2012

Having investigated this, I could only re-create it if I added the hgshelve extension to my ~/.hgrc while SourceTree was running. Once SourceTree was restarted, it correctly detected the new hgshelve extension and disabled it in the environment that SourceTree runs hg in.

So I think this must have just been a temporary problem - SourceTree checks for custom extensions and disables them (unless you choose to re-enable them) but only at startup. You could probably force it to refresh by changing the enabled custom extension list in Preferences, but you would need to close and re-open the dialog in between changes to make them take effect.

0 votes
Pawel Krakowiak October 15, 2012

I have the same problem with SourceTree 1.5.3. The only Mercurial installation that I had was the one from MacHg app, but I removed MacHg from my system along with its application data folder. SourceTree still throws that error.

Pawel Krakowiak October 15, 2012

Just installed version 1.5.5.1 (I didn't know there was something newer than 1.5.3) and it didn't help. I don't even have Mercurial installed in my system.

Pawel Krakowiak October 15, 2012

Got it working! I knew I installed manually the hgshelve extension some time before, I tracked it by going to *local working copy* settings (rather than app preferences) and opening the config file from there and I had this:

[extensions]
hgshelve=/Users/pawel/Tools/hgshelve.py

After removing those lines the shelve function in SourceTree started to work. Whew.

Suggest an answer

Log in or Sign up to answer
TAGS
AUG Leaders

Atlassian Community Events