Closed Bug 1235213 Opened 8 years ago Closed 8 years ago

reviewboard mercurial extension breaks "hg tag"

Categories

(MozReview Graveyard :: General, defect)

defect
Not set
normal

Tracking

(Not tracked)

RESOLVED FIXED

People

(Reporter: dbaron, Assigned: gps)

References

Details

Attachments

(1 file)

I was using the "hg tag" in a repository (unrelated to mozilla-central), and it raised an exception because of the reviewboard extension.  (It succeeded in modifying .hgtags, but failed to commit that change.)

Disabling the reviewboard extension made the problem go away.

$ hg version
Mercurial Distributed SCM (version 3.6.2)

$ hg tag release-0.1.5
** Unknown exception encountered with possibly-broken third-party extension qfixdrift
** which supports versions unknown of Mercurial.
** Please disable qfixdrift and try your action again.
** If that fixes the bug please report it to the extension author.
** Python 2.7.10 (default, Oct 14 2015, 16:09:02) [GCC 5.2.1 20151010]
** Mercurial Distributed SCM (version 3.6.2)
** Extensions loaded: strip, mq, convert, transplant, rebase, extdiff, qfixdrift, graphlog, bzexport, reviewboard, progress, hggit, histedit, bzpost, bundleclone, qimportbz
Traceback (most recent call last):
  File "/usr/local/bin/hg", line 43, in <module>
    mercurial.dispatch.run()
  File "/usr/local/mercurial-3.6.2/lib/python2.7/site-packages/mercurial/dispatch.py", line 54, in run
    sys.exit((dispatch(request(sys.argv[1:])) or 0) & 255)
  File "/usr/local/mercurial-3.6.2/lib/python2.7/site-packages/mercurial/dispatch.py", line 116, in dispatch
    ret = _runcatch(req)
  File "/usr/local/mercurial-3.6.2/lib/python2.7/site-packages/mercurial/dispatch.py", line 187, in _runcatch
    return _dispatch(req)
  File "/usr/local/mercurial-3.6.2/lib/python2.7/site-packages/mercurial/dispatch.py", line 920, in _dispatch
    cmdpats, cmdoptions)
  File "/usr/local/mercurial-3.6.2/lib/python2.7/site-packages/mercurial/dispatch.py", line 679, in runcommand
    ret = _runcommand(ui, options, cmd, d)
  File "/usr/local/mercurial-3.6.2/lib/python2.7/site-packages/mercurial/dispatch.py", line 1051, in _runcommand
    return checkargs()
  File "/usr/local/mercurial-3.6.2/lib/python2.7/site-packages/mercurial/dispatch.py", line 1011, in checkargs
    return cmdfunc()
  File "/usr/local/mercurial-3.6.2/lib/python2.7/site-packages/mercurial/dispatch.py", line 917, in <lambda>
    d = lambda: util.checksignature(func)(ui, *args, **cmdoptions)
  File "/usr/local/mercurial-3.6.2/lib/python2.7/site-packages/mercurial/util.py", line 801, in check
    return func(*args, **kwargs)
  File "/usr/local/mercurial-3.6.2/lib/python2.7/site-packages/mercurial/extensions.py", line 183, in closure
    return func(*(args + a), **kw)
  File "/usr/local/mercurial-3.6.2/lib/python2.7/site-packages/mercurial/util.py", line 801, in check
    return func(*args, **kwargs)
  File "/usr/local/mercurial-3.6.2/lib/python2.7/site-packages/hgext/mq.py", line 3525, in mqcommand
    return orig(ui, repo, *args, **kwargs)
  File "/usr/local/mercurial-3.6.2/lib/python2.7/site-packages/mercurial/util.py", line 801, in check
    return func(*args, **kwargs)
  File "/usr/local/mercurial-3.6.2/lib/python2.7/site-packages/mercurial/commands.py", line 6497, in tag
    editor=editor)
  File "/usr/local/mercurial-3.6.2/lib/python2.7/site-packages/mercurial/localrepo.py", line 647, in tag
    self._tag(names, node, message, local, user, date, editor=editor)
  File "/usr/local/mercurial-3.6.2/lib/python2.7/site-packages/mercurial/localrepo.py", line 64, in wrapper
    return orig(repo.unfiltered(), *args, **kwargs)
  File "/usr/local/mercurial-3.6.2/lib/python2.7/site-packages/mercurial/localrepo.py", line 612, in _tag
    editor=editor)
  File "/home/dbaron/.mozbuild/version-control-tools/hgext/reviewboard/client.py", line 1093, in commit
    if 'commitid' not in extra and self.reviews.remoteurl:
TypeError: argument of type 'NoneType' is not iterable


originally observed with:

~/.mozbuild/version-control-tools/hgext/reviewboard $ hg parent
changeset:   3217:eaa98dd31dc3

but also reproduces with:

~/.mozbuild/version-control-tools/hgext/reviewboard $ hg parent
changeset:   3621:c1fa09f2886d
This feels like the same issue we had with firefoxtrees in bug 1234396. Somehow the monkeypatched repo class gets lost as part of repo filtering. I'm starting to suspect an upstream regression...
fwiw - I just hit this too
This is due to a change in Mercurial 3.6 (https://selenic.com/repo/hg/rev/ed884807dc48). Fix should be trivial.
Assignee: nobody → gps
Status: NEW → ASSIGNED
Mercurial 3.6 changed the "extra" keyword argument from an empty
tuple to None. It's quite possible the mutability of that default
argument was leading to our previous code not erroring.

Setting the argument to an empty dict in all false-y cases makes the
issue go away.

Review commit: https://reviewboard.mozilla.org/r/32417/diff/#index_header
See other reviews: https://reviewboard.mozilla.org/r/32417/
Attachment #8712030 - Flags: review?(dminor)
Comment on attachment 8712030 [details]
MozReview Request: reviewboard: handle kwargs more robustly (bug 1235213); r?dminor

https://reviewboard.mozilla.org/r/32417/#review29149

lgtm
Attachment #8712030 - Flags: review?(dminor) → review+
Autolanded
Status: ASSIGNED → RESOLVED
Closed: 8 years ago
Resolution: --- → FIXED
Depends on: 1243161
Product: Developer Services → MozReview
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: