Bug 4097 - hg strip can fail if mq is not enabled
Summary: hg strip can fail if mq is not enabled
Status: RESOLVED FIXED
Alias: None
Product: Mercurial
Classification: Unclassified
Component: Mercurial (show other bugs)
Version: 2.8
Hardware: PC Linux
: normal bug
Assignee: Bugzilla
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2013-11-14 17:34 UTC by jbjoerk
Modified: 2014-01-06 10:46 UTC (History)
3 users (show)

See Also:
Python Version: ---


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description jbjoerk 2013-11-14 17:34 UTC
Traceback (most recent call last):
  File "/usr/local/external/public/mercurial/x86_64/2.8.0/bin/hg", line 38, in <module>
    mercurial.dispatch.run()
  File "/usr/local/external/public/mercurial/x86_64/2.8.0/lib/python2.7/site-packages/mercurial/dispatch.py", line 28, in run
    sys.exit((dispatch(request(sys.argv[1:])) or 0) & 255)
  File "/usr/local/external/public/mercurial/x86_64/2.8.0/lib/python2.7/site-packages/mercurial/dispatch.py", line 69, in dispatch
    ret = _runcatch(req)
  File "/usr/local/external/public/mercurial/x86_64/2.8.0/lib/python2.7/site-packages/mercurial/dispatch.py", line 133, in _runcatch
    return _dispatch(req)
  File "/usr/local/external/public/mercurial/x86_64/2.8.0/lib/python2.7/site-packages/mercurial/dispatch.py", line 806, in _dispatch
    cmdpats, cmdoptions)
  File "/usr/local/external/public/mercurial/x86_64/2.8.0/lib/python2.7/site-packages/mercurial/dispatch.py", line 585, in runcommand
    ret = _runcommand(ui, options, cmd, d)
  File "/usr/local/external/public/mercurial/x86_64/2.8.0/lib/python2.7/site-packages/mercurial/extensions.py", line 196, in wrap
    return wrapper(origfn, *args, **kwargs)
  File "/usr/local/external/public/mercurial/x86_64/2.8.0/lib/python2.7/site-packages/hgext/pager.py", line 138, in pagecmd
    return orig(ui, options, cmd, cmdfunc)
  File "/usr/local/external/public/mercurial/x86_64/2.8.0/lib/python2.7/site-packages/mercurial/extensions.py", line 196, in wrap
    return wrapper(origfn, *args, **kwargs)
  File "/usr/local/external/public/mercurial/x86_64/2.8.0/lib/python2.7/site-packages/hgext/color.py", line 419, in colorcmd
    return orig(ui_, opts, cmd, cmdfunc)
  File "/usr/local/external/public/mercurial/x86_64/2.8.0/lib/python2.7/site-packages/mercurial/dispatch.py", line 897, in _runcommand
    return checkargs()
  File "/usr/local/external/public/mercurial/x86_64/2.8.0/lib/python2.7/site-packages/mercurial/dispatch.py", line 868, in checkargs
    return cmdfunc()
  File "/usr/local/external/public/mercurial/x86_64/2.8.0/lib/python2.7/site-packages/mercurial/dispatch.py", line 803, in <lambda>
    d = lambda: util.checksignature(func)(ui, *args, **cmdoptions)
  File "/usr/local/external/public/mercurial/x86_64/2.8.0/lib/python2.7/site-packages/mercurial/util.py", line 512, in check
    return func(*args, **kwargs)
  File "/usr/local/external/public/mercurial/x86_64/2.8.0/lib/python2.7/site-packages/hgext/strip.py", line 215, in stripcmd
    strip(ui, repo, revs, backup=backup, update=update, force=opts.get('force'))
  File "/usr/local/external/public/mercurial/x86_64/2.8.0/lib/python2.7/site-packages/hgext/strip.py", line 54, in strip
    if p2 != nullid and p2 in [x.node for x in repo.mq.applied]:
  File "/usr/local/external/public/mercurial/x86_64/2.8.0/lib/python2.7/site-packages/mercurial/repoview.py", line 204, in __getattr__
    return getattr(self._unfilteredrepo, attr)
AttributeError: 'localrepository' object has no attribute 'mq'

Can be reproduced by:
phb@hsphb:~/hg2/hg3$ hg init
phb@hsphb:~/hg2/hg3$ touch a; hg add a; hg commit -m "a"
phb@hsphb:~/hg2/hg3$ hg up null
0 files updated, 0 files merged, 1 files removed, 0 files unresolved
phb@hsphb:~/hg2/hg3$ touch b; hg add b; hg commit -m "b"
created new head
phb@hsphb:~/hg2/hg3$ hg merge
1 files updated, 0 files merged, 0 files removed, 0 files unresolved
(branch merge, don't forget to commit)
phb@hsphb:~/hg2/hg3$ hg commit -m "merged"
phb@hsphb:~/hg2/hg3$ hg strip -r -1
Comment 1 HG Bot 2013-11-16 12:45 UTC
Fixed by http://selenic.com/repo/hg/rev/2802bedbd45f
Matt Mackall <mpm@selenic.com>
strip: fix last unprotected mq reference (issue4097)

(please test the fix)