1
0
mirror of https://github.com/golang/go synced 2024-11-26 01:57:56 -07:00

lib/codereview: fix with more recent hg revisions.

I've Mercurial version 3.2 and hg submit fails with:

  File "/home/agl/devel/go/lib/codereview/codereview.py", line 3567, in get_hg_status
    ret = hg_commands.status(fui, self.repo, *[], **{'rev': [rev], 'copies': True})
  File "/usr/lib/python2.7/site-packages/mercurial/commands.py", line 5714, in status
    fm = ui.formatter('status', opts)
  File "/home/agl/devel/go/lib/codereview/codereview.py", line 3464, in formatter
    return plainformatter(self, topic, opts)
  File "/usr/lib/python2.7/site-packages/mercurial/formatter.py", line 57, in __init__
    if ui.debugflag:
  AttributeError: 'FakeMercurialUI' object has no attribute 'debugflag'

This change dumbly adds a boolean debugflag and that seems to work.

LGTM=minux
R=rsc, minux
CC=golang-codereviews
https://golang.org/cl/167410043
This commit is contained in:
Adam Langley 2014-11-08 17:12:23 -08:00
parent cf105e2fa0
commit 03c008bcb2

View File

@ -3451,6 +3451,7 @@ class FakeMercurialUI(object):
def __init__(self):
self.quiet = True
self.output = ''
self.debugflag = False
def write(self, *args, **opts):
self.output += ' '.join(args)