在我曾经工作的Mercurial存储库中,当我运行hg status时,我得到:

** Unknown exception encountered with possibly-broken third-party extension qct
** which supports versions unknown of Mercurial.
** Please disable qct and try your action again.
** If that fixes the bug please report it to the extension author.
** Python 2.7.12 (default, Sep 29 2016, 13:30:34) [GCC 6.2.1 20160916 (Red Hat 6.2.1-2)]
** Mercurial Distributed SCM (version 3.7.3)
** Extensions loaded: qct, color, pager, extdiff, hgk, graphlog, hggit
Traceback (most recent call last):
  File "/usr/bin/hg", line 43, in <module>
    mercurial.dispatch.run()
  File "/usr/lib64/python2.7/site-packages/mercurial/dispatch.py", line 54, in run
    sys.exit((dispatch(request(sys.argv[1:])) or 0) & 255)
  File "/usr/lib64/python2.7/site-packages/mercurial/dispatch.py", line 120, in dispatch
    ret = _runcatch(req)
  File "/usr/lib64/python2.7/site-packages/mercurial/dispatch.py", line 191, in _runcatch
    return _dispatch(req)
  File "/usr/lib64/python2.7/site-packages/mercurial/dispatch.py", line 924, in _dispatch
    cmdpats, cmdoptions)
  File "/usr/lib64/python2.7/site-packages/mercurial/dispatch.py", line 681, in runcommand
    ret = _runcommand(ui, options, cmd, d)
  File "/usr/lib64/python2.7/site-packages/mercurial/extensions.py", line 195, in closure
    return func(*(args + a), **kw)
  File "/usr/lib64/python2.7/site-packages/hgext/pager.py", line 143, in pagecmd
    return orig(ui, options, cmd, cmdfunc)
  File "/usr/lib64/python2.7/site-packages/mercurial/extensions.py", line 195, in closure
    return func(*(args + a), **kw)
  File "/usr/lib64/python2.7/site-packages/hgext/color.py", line 518, in colorcmd
    return orig(ui_, opts, cmd, cmdfunc)
  File "/usr/lib64/python2.7/site-packages/mercurial/dispatch.py", line 1055, in _runcommand
    return checkargs()
  File "/usr/lib64/python2.7/site-packages/mercurial/dispatch.py", line 1015, in checkargs
    return cmdfunc()
  File "/usr/lib64/python2.7/site-packages/mercurial/dispatch.py", line 921, in <lambda>
    d = lambda: util.checksignature(func)(ui, *args, **cmdoptions)
  File "/usr/lib64/python2.7/site-packages/mercurial/util.py", line 991, in check
    return func(*args, **kwargs)
  File "/usr/lib64/python2.7/site-packages/mercurial/commands.py", line 6365, in status
    opts.get('subrepos'))
  File "/usr/lib64/python2.7/site-packages/mercurial/localrepo.py", line 1826, in status
    listsubrepos)
  File "/usr/lib64/python2.7/site-packages/mercurial/context.py", line 351, in status
    listunknown)
  File "/usr/lib64/python2.7/site-packages/mercurial/context.py", line 1620, in _buildstatus
    s = self._dirstatestatus(match, listignored, listclean, listunknown)
  File "/usr/lib64/python2.7/site-packages/mercurial/context.py", line 1589, in _dirstatestatus
    listclean, listunknown)
  File "/usr/lib64/python2.7/site-packages/mercurial/dirstate.py", line 1134, in status
    full=full).iteritems():
  File "/usr/lib64/python2.7/site-packages/mercurial/dirstate.py", line 950, in walk
    ignore = self._ignore
  File "/usr/lib64/python2.7/site-packages/mercurial/scmutil.py", line 1203, in __get__
    entry.obj = self.func(obj)
  File "/usr/lib/python2.7/site-packages/hggit/gitdirstate.py", line 128, in _ignore
    extrapatterns=patterns)
  File "/usr/lib/python2.7/site-packages/hggit/gitdirstate.py", line 101, in gignore
    return ignorefunc
UnboundLocalError: local variable 'ignorefunc' referenced before assignment

现在,我尚未启用qct扩展名,也无法在自己的.hgrc或存储库中的.hg / hgrc中找到它。这里发生了什么?如何解决/规避此问题?

注意:
  • 我不是root用户。
  • 我的操作系统是Fedora GNU / Linux24。
  • 最佳答案

    有可能是系统范围的配置文件。从hg help hgrc:

    当用户配置文件覆盖系统范围的配置文件时,您可以在本地禁用它。引用https://www.mercurial-scm.org/wiki/UsingExtensions:

    09-04 01:58