views:

72

answers:

2

We are just beginning to learn and evaluate Mercurial, due to an increasing number of nightmare merges, and various other problems we've had with SVN lately.

A client wants us to pull down a live copy of their site, do some SEO work on it, and push it back to them. They have no source control at all. I figure this is a great project to work on with Mercurial. Instead of putting it into our SVN and exporting when we are done, we'll use Mercurial... But right away it seems I have some problem :)

They have a file called ---.config which seems to cause our Mercurial to barf. It just can't commit that file. I've created the repo and committed everything else, but I just can't get this one file committed.

We are running on Windows 2008 x64 with TortoiseHG 1.0.

I suppose I could ignore the file since it is unlikely we'll need to work with it, but still - I'd like to learn how to use Mercurial a bit better. Is there a way around this?

EDIT: here is the error message:

('commit', GetoptError('option ---.config not recognized', '-.config'))

This happens when I hit the "commit" button in TortoiseHG with that file selected.

+3  A: 

Not sure about hg, but most command line tools treat anything after a -- as a non-option. This is helpful if you have a filename that starts with -- or a wildcard that picks up such a file; try prefixing your filename or wildcard with --, e.g., hg command -- *.config.

Marcelo Cantos
You're either suggesting he use `--` or you're saying that the start of `---.config` looks like `--`... I'm betting the former. Clarify?
Mike DeSimone
also, I'm not really looking to rename the file, the app uses it and that change would be beyond the scope of what I'm authorized to do on this project. I would like some way to tell tortoiseHg, or commandline hg if I *have* to, to commit it anyway.
Travis Laborde
+2  A: 

The problem is that TortoiseHg did not escape filenames correctly when calling hg. When a filename starts with --, one must take extra care when using it on command lines.

I have just sent a patch which will hopefully make it into TortoiseHg 1.0.1, which is scheduled to be released later today.

Martin Geisler
thanks Martin! I appreciate it.
Travis Laborde
No problem, I'm glad I noticed this just in time for the upcoming release! I've just tested it with TortoiseHg 1.0.1 and it now works as it should. If you find more weirdness, then please open bugs on the TortoiseHg bug tracker: http://bitbucket.org/tortoisehg/stable/issues/new/
Martin Geisler