Closed Bug 1273881 Opened 9 years ago Closed 4 years ago

bzexport requires mq but does not fail gracefully; throws wall-of-text exception instead

Categories

(Developer Services :: Mercurial: bzexport, defect)

defect
Not set
normal

Tracking

(Not tracked)

RESOLVED FIXED

People

(Reporter: lth, Assigned: sfink)

Details

Attachments

(2 files)

A simple bzexport with --review option (please read to the bottom): Requesting review from jorendorff@mozilla.com ** Unknown exception encountered with possibly-broken third-party extension bzpost ** which supports versions 3.6 of Mercurial. ** Please disable bzpost and try your action again. ** If that fixes the bug please report it to https://bugzilla.mozilla.org/enter_bug.cgi?product=Developer%20Services&component=Mercurial%3A%20bzpost ** Python 2.7.10 (default, Oct 14 2015, 16:09:02) [GCC 5.2.1 20151010] ** Mercurial Distributed SCM (version 3.7.2) ** Extensions loaded: strip, color, rebase, histedit, bzexport, bzpost, firefoxtree, push-to-try, reviewboard Traceback (most recent call last): File "/usr/local/bin/hg", line 43, in <module> mercurial.dispatch.run() File "/usr/local/lib/python2.7/dist-packages/mercurial/dispatch.py", line 54, in run sys.exit((dispatch(request(sys.argv[1:])) or 0) & 255) File "/usr/local/lib/python2.7/dist-packages/mercurial/dispatch.py", line 120, in dispatch ret = _runcatch(req) File "/usr/local/lib/python2.7/dist-packages/mercurial/dispatch.py", line 191, in _runcatch return _dispatch(req) File "/usr/local/lib/python2.7/dist-packages/mercurial/dispatch.py", line 924, in _dispatch cmdpats, cmdoptions) File "/usr/local/lib/python2.7/dist-packages/mercurial/dispatch.py", line 681, in runcommand ret = _runcommand(ui, options, cmd, d) File "/usr/local/lib/python2.7/dist-packages/mercurial/extensions.py", line 195, in closure return func(*(args + a), **kw) File "/usr/local/lib/python2.7/dist-packages/hgext/color.py", line 518, in colorcmd return orig(ui_, opts, cmd, cmdfunc) File "/usr/local/lib/python2.7/dist-packages/mercurial/dispatch.py", line 1055, in _runcommand return checkargs() File "/usr/local/lib/python2.7/dist-packages/mercurial/dispatch.py", line 1015, in checkargs return cmdfunc() File "/usr/local/lib/python2.7/dist-packages/mercurial/dispatch.py", line 921, in <lambda> d = lambda: util.checksignature(func)(ui, *args, **cmdoptions) File "/usr/local/lib/python2.7/dist-packages/mercurial/util.py", line 991, in check return func(*args, **kwargs) File "/home/lhansen/.mozbuild/version-control-tools/hgext/bzexport/__init__.py", line 1075, in bzexport newname = update_patch(ui, repo, rev, bug, update, rename, opts['interactive']) File "/home/lhansen/.mozbuild/version-control-tools/hgext/bzexport/__init__.py", line 641, in update_patch q = repo.mq File "/usr/local/lib/python2.7/dist-packages/mercurial/repoview.py", line 340, in __getattr__ return getattr(self._unfilteredrepo, attr) AttributeError: 'reviewboardrepo' object has no attribute 'mq' This appears to have been caused by my saying I did not want mq (since I stopped using it). Installing mq as part of mach mercurial-setup fixes the problem.
Yeah, sorry. Once in a while, I come back to whittle away at this. I very rarely use mq at this point, and only have it enabled for exactly this reason. I hadn't seen this particular symptom, but I fixed a few others (unlanded). I'll try to take another look at it.
I'd like to work on this bug. I'm a newbie and have only worked on 1 bug till now. (Requested by @jdm)
Above diff for the patch ignores whitespaces.
MozReview-Commit-ID: JkHVMJkRWWZ
Attachment #8848283 - Flags: review?(swapneshks)
Assignee: nobody → sphink
Status: NEW → ASSIGNED
Oops, sorry, I meant to comment with that upload. Thanks for the patch. Can you try out the above patch instead? I use bzexport without mq these days, but I still use the comment updating functionality. If you could try this out and see if it works for you, it should be good to land. I would prefer to have it tested in the test suite, but way back when I wrote this patch, I was having trouble setting it up. If you're really ambitious, you could add a test for this and make sure it works. I know that's a lot to ask, though.
(In reply to Steve Fink [:sfink] [:s:] from comment #6) > Thanks for the patch. Can you try out the above patch instead? I use > bzexport without mq these days, but I still use the comment updating > functionality. If you could try this out and see if it works for you, it > should be good to land. The 'obsolete_old_patches' seems to have changed quite a lot when compared to the patch. Hence, I could apply the patch only partially and I see the same wall-of-text exception. > I would prefer to have it tested in the test suite, but way back when I > wrote this patch, I was having trouble setting it up. If you're really > ambitious, you could add a test for this and make sure it works. I know > that's a lot to ask, though. I could try adding the test if guided a bit along the way. Would be great for learning...
Comment on attachment 8848283 [details] [diff] [review] Amend top commit with bug number when not using mq Review of attachment 8848283 [details] [diff] [review]: ----------------------------------------------------------------- The 'obsolete_old_patches' method in latest version of the file seems to have changed quite a lot when compared to the version of the file in the patch. Hence, I could apply the patch only partially and I see the same wall-of-text exception.
Attachment #8848283 - Flags: review?(swapneshks) → review-
Comment on attachment 8848150 [details] [diff] [review] Add fix to handle attribute 'mq' not found gracefully Review of attachment 8848150 [details] [diff] [review]: ----------------------------------------------------------------- I'm going to mark this r+ just to get it in, since someone else hit it too. I rebased my patch stack, and the new version of my patch does work (since I'm running with it), but I'll put that on a different bug.
Attachment #8848150 - Flags: review+
Other patch is at bug 1354312.
Status: ASSIGNED → RESOLVED
Closed: 4 years ago
Resolution: --- → FIXED
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: