开发者

mercurial fails with a file named ---.config - any way around this?

开发者 https://www.devze.com 2022-12-24 14:04 出处:网络
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.

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.


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.


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.

0

精彩评论

暂无评论...
验证码 换一张
取 消