Issue #23 open

Shelving crashes on Mercurial 2.1 and below

Pablo  Rivera Conde avatarPablo Rivera Conde created an issue

Hi,

I'm trying to shelve some changes, and I get the following error:

$ hg shelve --all
shelving failed: 'module' object has no attribute 'revert'
** unknown exception encountered, please report by visiting
**  http://mercurial.selenic.com/wiki/BugTracker
** Python 2.7.3 (default, Aug  1 2012, 05:14:39) [GCC 4.6.3]
** Mercurial Distributed SCM (version 2.0.2)
** Extensions loaded: fetch, extdiff, hgk, color, graphlog, hgshelve
Traceback (most recent call last):
  File "/usr/bin/hg", line 38, in <module>
    mercurial.dispatch.run()
  File "/usr/lib/python2.7/dist-packages/mercurial/dispatch.py", line 27, in run
    sys.exit(dispatch(request(sys.argv[1:])))
  File "/usr/lib/python2.7/dist-packages/mercurial/dispatch.py", line 64, in dispatch
    return _runcatch(req)
  File "/usr/lib/python2.7/dist-packages/mercurial/dispatch.py", line 87, in _runcatch
    return _dispatch(req)
  File "/usr/lib/python2.7/dist-packages/mercurial/dispatch.py", line 684, in _dispatch
    cmdpats, cmdoptions)
  File "/usr/lib/python2.7/dist-packages/mercurial/dispatch.py", line 466, in runcommand
    ret = _runcommand(ui, options, cmd, d)
  File "/usr/lib/python2.7/dist-packages/mercurial/extensions.py", line 184, in wrap
    return wrapper(origfn, *args, **kwargs)
  File "/usr/lib/python2.7/dist-packages/hgext/color.py", line 373, in colorcmd
    return orig(ui_, opts, cmd, cmdfunc)
  File "/usr/lib/python2.7/dist-packages/mercurial/dispatch.py", line 738, in _runcommand
    return checkargs()
  File "/usr/lib/python2.7/dist-packages/mercurial/dispatch.py", line 692, in checkargs
    return cmdfunc()
  File "/usr/lib/python2.7/dist-packages/mercurial/dispatch.py", line 681, in <lambda>
    d = lambda: util.checksignature(func)(ui, *args, **cmdoptions)
  File "/usr/lib/python2.7/dist-packages/mercurial/util.py", line 458, in check
    return func(*args, **kwargs)
  File "/home/pablo/.hgexts/hgshelve/hgshelve.py", line 557, in shelve
    return cmdutil.commit(ui, repo, shelvefunc, pats, opts)
  File "/usr/lib/python2.7/dist-packages/mercurial/cmdutil.py", line 1223, in commit
    scmutil.match(repo[None], pats, opts), opts)
  File "/home/pablo/.hgexts/hgshelve/hgshelve.py", line 518, in shelvefunc
    cmdutil.forget(ui, repo, matchremoved, "", True)
AttributeError: 'module' object has no attribute 'forget'
Error in sys.excepthook:
Traceback (most recent call last):
  File "/usr/lib/python2.7/dist-packages/apport_python_hook.py", line 66, in apport_excepthook
    from apport.fileutils import likely_packaged, get_recent_crashes
  File "/usr/lib/python2.7/dist-packages/mercurial/demandimport.py", line 95, in _demandimport
    return _import(name, globals, locals, fromlist, level)
  File "/usr/lib/python2.7/dist-packages/apport/__init__.py", line 1, in <module>
    from apport.report import Report
  File "/usr/lib/python2.7/dist-packages/mercurial/demandimport.py", line 114, in _demandimport
    mod = _origimport(name, globals, locals)
  File "/usr/lib/python2.7/dist-packages/apport/report.py", line 155, in <module>
    class Report(problem_report.ProblemReport):
  File "/usr/lib/python2.7/dist-packages/mercurial/demandimport.py", line 86, in __getattribute__
    self._load()
  File "/usr/lib/python2.7/dist-packages/mercurial/demandimport.py", line 58, in _load
    mod = _origimport(head, globals, locals)
  File "/usr/lib/python2.7/dist-packages/problem_report.py", line 93, in <module>
    class ProblemReport(UserDict):
TypeError: Error when calling the metaclass bases
    module.__init__() takes at most 2 arguments (3 given)

Original exception was:
Traceback (most recent call last):
  File "/usr/bin/hg", line 38, in <module>
    mercurial.dispatch.run()
  File "/usr/lib/python2.7/dist-packages/mercurial/dispatch.py", line 27, in run
    sys.exit(dispatch(request(sys.argv[1:])))
  File "/usr/lib/python2.7/dist-packages/mercurial/dispatch.py", line 64, in dispatch
    return _runcatch(req)
  File "/usr/lib/python2.7/dist-packages/mercurial/dispatch.py", line 87, in _runcatch
    return _dispatch(req)
  File "/usr/lib/python2.7/dist-packages/mercurial/dispatch.py", line 684, in _dispatch
    cmdpats, cmdoptions)
  File "/usr/lib/python2.7/dist-packages/mercurial/dispatch.py", line 466, in runcommand
    ret = _runcommand(ui, options, cmd, d)
  File "/usr/lib/python2.7/dist-packages/mercurial/extensions.py", line 184, in wrap
    return wrapper(origfn, *args, **kwargs)
  File "/usr/lib/python2.7/dist-packages/hgext/color.py", line 373, in colorcmd
    return orig(ui_, opts, cmd, cmdfunc)
  File "/usr/lib/python2.7/dist-packages/mercurial/dispatch.py", line 738, in _runcommand
    return checkargs()
  File "/usr/lib/python2.7/dist-packages/mercurial/dispatch.py", line 692, in checkargs
    return cmdfunc()
  File "/usr/lib/python2.7/dist-packages/mercurial/dispatch.py", line 681, in <lambda>
    d = lambda: util.checksignature(func)(ui, *args, **cmdoptions)
  File "/usr/lib/python2.7/dist-packages/mercurial/util.py", line 458, in check
    return func(*args, **kwargs)
  File "/home/pablo/.hgexts/hgshelve/hgshelve.py", line 557, in shelve
    return cmdutil.commit(ui, repo, shelvefunc, pats, opts)
  File "/usr/lib/python2.7/dist-packages/mercurial/cmdutil.py", line 1223, in commit
    scmutil.match(repo[None], pats, opts), opts)
  File "/home/pablo/.hgexts/hgshelve/hgshelve.py", line 518, in shelvefunc
    cmdutil.forget(ui, repo, matchremoved, "", True)
AttributeError: 'module' object has no attribute 'forget'

Maybe its caused for an incompatibility with Mercurial 2.0.2.

Am I doing anything wrong?

Comments (7)

  1. Kieran Simpson

    Having just had this problem I think it would be really good if the history could be labelled (tags, bookmarks, whatever) to indicate what versions of Hg this extension supports.

  2. Oleg Oshmyan

    Ugh! I should’ve triple-checked my tags before pushing them. Expect another tag change commit soon. Sorry for the cluttered history. (Although I’m probably annoyed by it more than anyone else is… Well, along with the contributors who I’ve demanded clean history from.)

    While I’m at it:

    Indeed, hgshelve attempts to call a function that was added in Mercurial 2.1. I’ll see if this can be avoided relatively easily, but for now I’ll say 2.1 is required since changeset e8674d523531.

    2.2, not 2.1.

  3. Log in to comment
Tip: Filter by directory path e.g. /media app.js to search for public/media/app.js.
Tip: Use camelCasing e.g. ProjME to search for ProjectModifiedEvent.java.
Tip: Filter by extension type e.g. /repo .js to search for all .js files in the /repo directory.
Tip: Separate your search with spaces e.g. /ssh pom.xml to search for src/ssh/pom.xml.
Tip: Use ↑ and ↓ arrow keys to navigate and return to view the file.
Tip: You can also navigate files with Ctrl+j (next) and Ctrl+k (previous) and view the file with Ctrl+o.
Tip: You can also navigate files with Alt+j (next) and Alt+k (previous) and view the file with Alt+o.