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

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