Commit 03c008bc authored by Adam Langley's avatar Adam Langley

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
parent cf105e2f
...@@ -3451,6 +3451,7 @@ class FakeMercurialUI(object): ...@@ -3451,6 +3451,7 @@ class FakeMercurialUI(object):
def __init__(self): def __init__(self):
self.quiet = True self.quiet = True
self.output = '' self.output = ''
self.debugflag = False
def write(self, *args, **opts): def write(self, *args, **opts):
self.output += ' '.join(args) self.output += ' '.join(args)
......
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