一位Krtek發現,你在做什麼應該工作。這裏是我運行在本地:
~$ mkdir -p httpdocs/css/ui-lightness
~$ cd httpdocs/
~/httpdocs$ hg init
~/httpdocs$ echo test > css/ui-lightness/file
~/httpdocs$ hg commit -A -m "initial commit, old location"
adding css/ui-lightness/file
~/httpdocs$ hg rename css/ui-lightness css/jquery/themes/ui-lightness
moving css/ui-lightness/file to css/jquery/themes/ui-lightness/file
~/httpdocs$ ;s
bash: syntax error near unexpected token `;'
~/httpdocs$ ls
css
~/httpdocs$ tree
.
`-- css
`-- jquery
`-- themes
`-- ui-lightness
`-- file
4 directories, 1 file
~/httpdocs$ hg stat
A css/jquery/themes/ui-lightness/file
R css/ui-lightness/file
如果您有任何未追蹤(可能忽略)文件httpdocs/css/ui-lightness
他們將不會被重命名,因此目錄不會是空的,因此不會被刪除,但被跟蹤內容該目錄應該被移動。
注意我還沒有提交重命名(即使Mercurial知道它是重命名,它顯示爲Add和Remove),但是爲了反映在其他克隆中,我需要hg commit
,hg push
,他們必須hg pull
,然後hg update
或hg merge
。
你是對的。該目錄並未被刪除,因爲它包含未跟蹤的文件(即無聊的.DS_Store文件)! – Hobbes 2011-03-10 19:58:33
這足以讓你在資源分支的時代長久。很高興它解決了。 – 2011-03-10 20:32:09