如何在git-hg存储库中删除hg lock?

时间:2015-08-28 14:10:36

标签: git mercurial locking

当我为存储库git pull origin master(设置为远程hg::http://hg.openjdk.java.net/jdk8u/jdk8u/corba/)运行origin时,挂起

waiting for lock on repository /mnt/main/sources/jdk8u-jdk8u/.git/modules/corba/hg/origin/clone held by 'richter-Lenovo-IdeaPad-Z500-Touch\xef\x80\xa217970'

使用 Ctrl + C 中断显示以下跟踪

^CTraceback (most recent call last):
  File "/usr/bin/git-remote-hg", line 1322, in <module>

    sys.exit(main(sys.argv))
  File "/usr/bin/git-remote-hg", line 1286, in main
richter@richtercloud:/mnt/main/sources/jdk8u-jdk8u/corba$     repo = get_repo(url, alias)
  File "/usr/bin/git-remote-hg", line 433, in get_repo
    repo.pull(peer, heads=None, force=True)
  File "/usr/lib/python2.7/dist-packages/mercurial/localrepo.py", line 1578, in pull
    return exchange.pull (self, remote, heads, force)
  File "/usr/lib/python2.7/dist-packages/mercurial/exchange.py", line 559, in pull
    lock = pullop.repo.lock()
  File "/usr/lib/python2.7/dist-packages/mercurial/localrepo.py", line 1098, in lock
    self.invalidate, _('repository %s') % self.origroot)
  File "/usr/lib/python2.7/dist-packages/mercurial/localrepo.py", line 1064, in _lock
    releasefn, desc=desc)
  File "/usr/lib/python2.7/dist-packages/mercurial/lock.py", line 41, in __init__
    self.delay = self.lock()
  File "/usr/lib/python2.7/dist-packages/mercurial/lock.py", line 63, in lock
    time.sleep(1)
KeyboardInterrupt

hg存储库中,可以使用Mercurial stuck "waiting for lock"中的解决方案解决此问题,但在git-hg中(没有.hg目录)?

2 个答案:

答案 0 :(得分:1)

尝试通过运行以下命令找到您的目录 -

find / -name ".hg/store/" - &gt; /将从根文件夹开始查找您的目录。以root用户身份运行命令以访问所有文件夹。

然后关注帖子mercurial-stuck-waiting-for-lock

答案 1 :(得分:0)

.hg存储库(通常位于源/结帐根目录下)可在.git/hg/.hg/处获得。可以在Mercurial stuck "waiting for lock"之后删除锁定。