Commit 938e07d7 authored by Yuya Nishihara's avatar Yuya Nishihara

version: disable color while fetching liveversion()

This fixes the following error:

Traceback (most recent call last):
  File "tortoisehg/util/version.py", line 46, in version
    branch, version = liveversion()
  File "tortoisehg/util/version.py", line 30, in liveversion
    commands.identify(u, repo, id=True, tags=True, rev=b'.')
  File "mercurial/commands.py", line 3260, in identify
    ctx = scmutil.revsingle(repo, rev, None)
  File "mercurial/scmutil.py", line 655, in revsingle
    l = revrange(repo, [revspec], localalias=localalias)
  File "mercurial/scmutil.py", line 712, in revrange
    return repo.anyrevs(allspecs, user=True, localalias=localalias)
  File "mercurial/localrepo.py", line 1510, in anyrevs
    return m(self)
  File "mercurial/revset.py", line 2403, in mfunc
    subset = fullreposet(repo)
  File "mercurial/smartset.py", line 1093, in __init__
    repo.changelog.filteredrevs)
  File "mercurial/repoview.py", line 261, in changelog
    revs = filterrevs(unfi, self.filtername, self._visibilityexceptions)
  File "mercurial/repoview.py", line 200, in filterrevs
    repo.filteredrevcache[filtername] = func(repo.unfiltered())
  File "mercurial/repoview.py", line 81, in computehidden
    hidden = hideablerevs(repo)
  File "mercurial/repoview.py", line 35, in hideablerevs
    obsoletes = obsolete.getrevs(repo, 'obsolete')
  File "mercurial/obsolete.py", line 835, in getrevs
    if not repo.obsstore:
  File "mercurial/localrepo.py", line 100, in __get__
    return super(_basefilecache, self).__get__(unfi, type)
  File "mercurial/scmutil.py", line 1473, in __get__
    entry.obj = self.func(obj)
  File "mercurial/localrepo.py", line 1299, in obsstore
    return obsolete.makestore(self.ui, self)
  File "mercurial/obsolete.py", line 756, in makestore
    % len(list(store)))
  File "mercurial/ui.py", line 1596, in warn
    self._writemsg(self._fmsgerr, type='warning', *msg, **opts)
  File "mercurial/ui.py", line 1100, in _writemsg
    _writemsgwith(self._write, dest, *args, **opts)
  File "mercurial/ui.py", line 2135, in _writemsgwith
    write(dest, *args, **opts)
  File "mercurial/ui.py", line 1060, in _write
    self._writenobuf(dest, *args, **opts)
  File "mercurial/ui.py", line 1083, in _writenobuf
    msg = self.label(msg, label)
  File "mercurial/ui.py", line 1858, in label
    return color.colorlabel(self, msg, label)
  File "mercurial/color.py", line 398, in colorlabel
    for line in msg.split('\n')])
  File "mercurial/color.py", line 368, in _render_effects
    for e in ['none'] + effects.split()]
KeyError: '#ffffaa_background'

--HG--
branch : stable
parent a1e3645a78a1
......@@ -21,6 +21,9 @@ def liveversion():
raise error.RepoError(_('repository %s not found') % thgpath)
u = ui.ui()
# disable color since qtlib inserts color styles and breaks
# mercurial.color._render_effects()
u.setconfig(b'ui', b'color', b'never')
# prevent loading additional extensions
for k, _v in u.configitems(b'extensions'):
u.setconfig(b'extensions', k, b'!')
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment