【问题标题】:Error "Unlinking directory not permitted" when I'm doing hg update with cygwin当我使用 cygwin 进行 hg 更新时出现错误“不允许取消链接目录”
【发布时间】:2014-03-12 20:42:35
【问题描述】:

当我尝试更改我所在的分支时,每次都会收到此错误:

# Just check in which branch I am
$ hg branch
django1.6

$ hg update --clean default
abandon: Unlinking directory not permitted: 'D:\Projects\abc\abc'

abc 是项目名称,此处为简单起见替换)。因为它是一个名为 abc 的 Django 项目,所以我在 django1.6 分支中创建了一个子文件夹 abc。此文件夹默认分支中尚不存在,所以如果我要更改分支,理论上必须删除该文件夹
当我检查属性时,我看到文件夹处于只读模式,所以在 cygwin 中我 chmod 文件夹并重试...

$ chmod -R 0777 hstareal/
$ hg update --clean default
abandon: Unlinking directory not permitted: 'D:\Projects\abc\abc'
$ hg update --clean another-already-existing-branch
abandon: Unlinking directory not permitted: 'D:\Projects\abc\abc'

有关信息,我可以创建一个分支并毫无问题地返回django1.6

$ hg branch test
marked working directory as branch test
(branches are permanent and global, did you want a bookmark?)

$ hg update --clean django1.6
0 files updated, 0 files merged, 0 files removed, 0 files unresolved

有人知道问题出在哪里吗?我确定这与cygwin有关,但我不明白为什么。

【问题讨论】:

    标签: mercurial cygwin branch unlink


    【解决方案1】:

    我目前发现的唯一解决方法是手动删除文件夹,然后更新分支。

    $ rm -rf abc/
    $ hg update --clean default
    27 files updated, 0 files merged, 4 files removed, 0 files unresolved
    

    真的很脏,但至少它有效......我仍在听取更好的建议:)

    【讨论】:

      猜你喜欢
      • 2014-12-03
      • 2015-10-27
      • 1970-01-01
      • 1970-01-01
      • 2019-11-04
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多