2012-01-31 124 views
2

我剛開始使用Mercurial,爲Windows下載並安裝了hg命令行,克隆了一個新的BitBucket存儲庫,添加了一個文件,但是當我提交時出現此錯誤:水銀錯誤 - 找不到文件

>hg commit -m 'first commit' 
abort: commit': The system cannot find the file specified 

添加的文件肯定在存儲庫文件夾中。當我運行狀態汞柱,我得到:

A Ant.java 

並添加--traceback在提交信息打動了我:

Traceback (most recent call last): 
    File "mercurial\dispatch.pyc", line 87, in _runcatch 
    File "mercurial\dispatch.pyc", line 684, in _dispatch 
    File "mercurial\dispatch.pyc", line 466, in runcommand 
    File "mercurial\dispatch.pyc", line 738, in _runcommand 
    File "mercurial\dispatch.pyc", line 692, in checkargs 
    File "mercurial\dispatch.pyc", line 681, in <lambda> 
    File "mercurial\util.pyc", line 458, in check 
    File "mercurial\commands.pyc", line 1194, in commit 
    File "mercurial\cmdutil.pyc", line 1223, in commit 
    File "mercurial\commands.pyc", line 1189, in commitfunc 
    File "mercurial\localrepo.pyc", line 1036, in commit 
    File "mercurial\localrepo.pyc", line 1295, in status 
    File "mercurial\dirstate.pyc", line 685, in status 
    File "mercurial\dirstate.pyc", line 594, in walk 
    File "mercurial\localrepo.pyc", line 1016, in fail 
Abort: commit': The system cannot find the file specified 
abort: commit': The system cannot find the file specified 

在谷歌搜索的問題,說不完的TortoiseHG引用的出現。我確實曾經安裝過,但擺脫它並重新啓動,系統上似乎沒有剩下任何東西。關於我可以嘗試什麼,或者我可能犯了什麼錯誤的想法?

回答

8

使用雙引號:hg commit -m "first commit"

+1

好抓!我們試圖用雙引號將我們的例子寫在['hg help revsets'](http://selenic.com/hg/help/revsets)的底部,因爲單引號在Windows上不起作用。 – 2012-01-31 12:24:12

+0

保存了我毆打某人/某物的東西:) Atlassian文檔有單引號,確實是問題所在。他們第一次錯了:P – Jimbo 2016-07-22 07:11:50

1

只是要注意,你可以得到這個錯誤是由於無意中具有儀表板和m個即 - m而不是-m之間的空間。