Closed Bug 1241615 Opened 5 years ago Closed 5 years ago

AttributeError: 'module' object has no attribute 'readcurrent' in Mercurial 3.7

Categories

(MozReview Graveyard :: General, defect)

defect
Not set
normal

Tracking

(Not tracked)

RESOLVED FIXED

People

(Reporter: gps, Assigned: gps)

Details

Attachments

(1 file)

The reviewboard client extension is broken in Mercurial 3.7.

+  (adding commit id to 1 changesets)
+  transaction abort!
+  rollback completed
+  ** Unknown exception encountered with possibly-broken third-party extension reviewboard
+  ** which supports versions 3.6 of Mercurial.
+  ** Please disable reviewboard 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=MozReview
+  ** Python 2.7.11 (default, Dec  5 2015, 14:44:53) [GCC 4.2.1 Compatible Apple LLVM 7.0.0 (clang-700.1.76)]
+  ** Mercurial Distributed SCM (version 3.7-rc)
+  ** Extensions loaded: strip, reviewboard, mq, rebase
+  Traceback (most recent call last):
+    File "/Users/gps/src/hgcustom/version-control-tools/venv/mercurials/@/bin/hg", line 43, in <module>
+      mercurial.dispatch.run()
+    File "/Users/gps/src/hgcustom/version-control-tools/venv/mercurials/@/lib/python2.7/site-packages/mercurial/dispatch.py", line 54, in run
+      sys.exit((dispatch(request(sys.argv[1:])) or 0) & 255)
+    File "/Users/gps/src/hgcustom/version-control-tools/venv/mercurials/@/lib/python2.7/site-packages/mercurial/dispatch.py", line 120, in dispatch
+      ret = _runcatch(req)
+    File "/Users/gps/src/hgcustom/version-control-tools/venv/mercurials/@/lib/python2.7/site-packages/mercurial/dispatch.py", line 191, in _runcatch
+      return _dispatch(req)
+    File "/Users/gps/src/hgcustom/version-control-tools/venv/mercurials/@/lib/python2.7/site-packages/mercurial/dispatch.py", line 924, in _dispatch
+      cmdpats, cmdoptions)
+    File "/Users/gps/src/hgcustom/version-control-tools/venv/mercurials/@/lib/python2.7/site-packages/mercurial/dispatch.py", line 681, in runcommand
+      ret = _runcommand(ui, options, cmd, d)
+    File "/Users/gps/src/hgcustom/version-control-tools/venv/mercurials/@/lib/python2.7/site-packages/mercurial/dispatch.py", line 1055, in _runcommand
+      return checkargs()
+    File "/Users/gps/src/hgcustom/version-control-tools/venv/mercurials/@/lib/python2.7/site-packages/mercurial/dispatch.py", line 1015, in checkargs
+      return cmdfunc()
+    File "/Users/gps/src/hgcustom/version-control-tools/venv/mercurials/@/lib/python2.7/site-packages/mercurial/dispatch.py", line 921, in <lambda>
+      d = lambda: util.checksignature(func)(ui, *args, **cmdoptions)
+    File "/Users/gps/src/hgcustom/version-control-tools/venv/mercurials/@/lib/python2.7/site-packages/mercurial/util.py", line 991, in check
+      return func(*args, **kwargs)
+    File "/Users/gps/src/hgcustom/version-control-tools/venv/mercurials/@/lib/python2.7/site-packages/mercurial/extensions.py", line 195, in closure
+      return func(*(args + a), **kw)
+    File "/Users/gps/src/hgcustom/version-control-tools/venv/mercurials/@/lib/python2.7/site-packages/mercurial/util.py", line 991, in check
+      return func(*args, **kwargs)
+    File "/Users/gps/src/hgcustom/version-control-tools/venv/mercurials/@/lib/python2.7/site-packages/hgext/mq.py", line 3516, in mqcommand
+      return orig(ui, repo, *args, **kwargs)
+    File "/Users/gps/src/hgcustom/version-control-tools/venv/mercurials/@/lib/python2.7/site-packages/mercurial/util.py", line 991, in check
+      return func(*args, **kwargs)
+    File "/Users/gps/src/hgcustom/version-control-tools/venv/mercurials/@/lib/python2.7/site-packages/mercurial/extensions.py", line 195, in closure
+      return func(*(args + a), **kw)
+    File "/Users/gps/src/hgcustom/version-control-tools/venv/mercurials/@/lib/python2.7/site-packages/mercurial/util.py", line 991, in check
+      return func(*args, **kwargs)
+    File "/Users/gps/src/hgcustom/version-control-tools/hgext/reviewboard/client.py", line 207, in pushcommand
+      return orig(ui, repo, *args, **kwargs)
+    File "/Users/gps/src/hgcustom/version-control-tools/venv/mercurials/@/lib/python2.7/site-packages/mercurial/util.py", line 991, in check
+      return func(*args, **kwargs)
+    File "/Users/gps/src/hgcustom/version-control-tools/venv/mercurials/@/lib/python2.7/site-packages/mercurial/commands.py", line 5738, in push
+      opargs=opts.get('opargs'))
+    File "/Users/gps/src/hgcustom/version-control-tools/venv/mercurials/@/lib/python2.7/site-packages/mercurial/extensions.py", line 195, in closure
+      return func(*(args + a), **kw)
+    File "/Users/gps/src/hgcustom/version-control-tools/hgext/reviewboard/client.py", line 331, in wrappedpush
+      **kwargs)
+    File "/Users/gps/src/hgcustom/version-control-tools/venv/mercurials/@/lib/python2.7/site-packages/mercurial/exchange.py", line 442, in push
+      _pushdiscovery(pushop)
+    File "/Users/gps/src/hgcustom/version-control-tools/venv/mercurials/@/lib/python2.7/site-packages/mercurial/extensions.py", line 195, in closure
+      return func(*(args + a), **kw)
+    File "/Users/gps/src/hgcustom/version-control-tools/hgext/reviewboard/client.py", line 458, in wrappedpushdiscovery
+      backuptopic='addcommitid')
+    File "/Users/gps/src/hgcustom/version-control-tools/pylib/mozhg/mozhg/rewrite.py", line 253, in replacechangesets
+      oldactivebookmark = activebookmark(repo)
+    File "/Users/gps/src/hgcustom/version-control-tools/pylib/mozhg/mozhg/rewrite.py", line 25, in activebookmark
+      return bookmarks.readcurrent(repo)
+  AttributeError: 'module' object has no attribute 'readcurrent'
+  [1]
Mercurial 3.7 changed the API yet again. It looks like
repo._activebookmark is the most appropriate way to access the active
bookmark, so just use that if it is defined.

Review commit: https://reviewboard.mozilla.org/r/31873/diff/#index_header
See other reviews: https://reviewboard.mozilla.org/r/31873/
Attachment #8710802 - Flags: review?(dminor)
https://reviewboard.mozilla.org/r/31873/#review28607

::: pylib/mozhg/mozhg/rewrite.py:21
(Diff revision 1)
> +# Mercurial 3.7 renamed readactive to _readactive.

that comment should say _activebookmark not _readactive
Comment on attachment 8710802 [details]
MozReview Request: mozhg: access active bookmark properly (bug 1241615); r?dminor

https://reviewboard.mozilla.org/r/31873/#review28651

lgtm module glob's issue
Attachment #8710802 - Flags: review?(dminor) → review+
https://reviewboard.mozilla.org/r/31873/#review28651

modulo, apparently I type one far more often than the other
Assignee: nobody → gps
Status: NEW → RESOLVED
Closed: 5 years ago
Resolution: --- → FIXED
Product: Developer Services → MozReview
You need to log in before you can comment on or make changes to this bug.