Edgewall Software
Modify

Opened 12 years ago

Last modified 8 years ago

#10719 new defect

Abort: cannot follow file not in parent revision: "tracext/hg/backend.py"

Reported by: Christian Boos Owned by:
Priority: normal Milestone: plugin - mercurial
Component: plugin/mercurial Version: 0.13dev
Severity: major Keywords:
Cc: Branch:
Release Notes:
API Changes:
Internal Changes:

Description

Looks like we have a problem with walkchangerevs once again…

It doesn't happen for me with with Mercurial 2.0.2, but happens here with 2.2.1.

How to Reproduce

While doing a GET operation on /log/mercurial-plugin/tracext/hg/backend.py, Trac issued an internal error.

Request parameters:

{'path': u'/mercurial-plugin/tracext/hg/backend.py', 'rev': u'3'}

User agent: Mozilla/5.0 (Windows NT 6.1; WOW64) AppleWebKit/536.11 (KHTML, like Gecko) Chrome/20.0.1132.21 Safari/536.11

System Information

Trac 0.13dev-r11050

Mercurial 2.2.1
mod_wsgi 3.3 (WSGIProcessGroup trac WSGIApplicationGroup %{GLOBAL})
Python 2.6.6 (r266:84292, Dec 26 2010, 22:48:11)
[GCC 4.4.5]

Enabled Plugins

TracMercurial 0.13.0.5dev

Python Traceback

Traceback (most recent call last):
  File "/usr/local/virtualenv/0.13-stable/lib/python2.6/site-packages/Trac-0.13dev_r11050-py2.6.egg/trac/web/main.py", line 480, in _dispatch_request
    dispatcher.dispatch(req)
  File "/usr/local/virtualenv/0.13-stable/lib/python2.6/site-packages/Trac-0.13dev_r11050-py2.6.egg/trac/web/main.py", line 198, in dispatch
    resp = chosen_handler.process_request(req)
  File "/usr/local/virtualenv/0.13-stable/lib/python2.6/site-packages/Trac-0.13dev_r11050-py2.6.egg/trac/versioncontrol/web_ui/log.py", line 172, in process_request
    for old_path, old_rev, old_chg in history():
  File "/usr/local/virtualenv/0.13-stable/lib/python2.6/site-packages/Trac-0.13dev_r11050-py2.6.egg/trac/versioncontrol/web_ui/log.py", line 163, in history
    for h in node.get_history():
  File "/usr/local/virtualenv/0.13-stable/lib/python2.6/site-packages/TracMercurial-0.13.0.5dev-py2.6.egg/tracext/hg/backend.py", line 1092, in _get_history_1_4
    for ctx in cmdutil.walkchangerevs(repo, matcher, opts, prep):
  File "/usr/lib/python2.6/dist-packages/mercurial/cmdutil.py", line 1058, in walkchangerevs
    for file_, node in iterfiles():
  File "/usr/lib/python2.6/dist-packages/mercurial/cmdutil.py", line 1052, in iterfiles
    'revision: "%s"') % filename)
Abort: cannot follow file not in parent revision: "tracext/hg/backend.py"

Attachments (0)

Change History (7)

comment:1 by Christian Boos, 12 years ago

The check which fails was apparently added here:

http://selenic.com/pipermail/mercurial-devel/2012-February/038249.html

comment:2 by Christian Boos, 12 years ago

comment:3 by Christian Boos, 12 years ago

+            pctx = repo['.']

Ugh. Time to say goodbye to walkchangerevs

comment:4 by Christian Boos, 12 years ago

The call in question in the plugin is: source:mercurial-plugin/tracext/hg/backend.py@8af21bda2b3e#L1064 (in _get_history_1_4)

comment:5 by Christian Boos, 12 years ago

While waiting for a fix in Mercurial itself, one can apply the following patch to mercurial:

  • mercurial/cmdutil.py

    old new  
    996996    revs = scmutil.revrange(repo, opts['rev'] or [defrange])
    997997    if not revs:
    998998        return []
     999    pctx = repo[revs[0]]
    9991000    wanted = set()
    10001001    slowpath = match.anypats() or (match.files() and opts.get('removed'))
    10011002    fncache = {}
     
    10441045
    10451046            return reversed(revs)
    10461047        def iterfiles():
    1047             pctx = repo['.']
    10481048            for filename in match.files():
    10491049                if follow:
    10501050                    if filename not in pctx:

comment:6 by Christian Boos, 12 years ago

As the discussion for fixing that issue in Mercurial went nowhere (also because walkchangerevs is seen as deprecated anyway), let's try to find a workaround.

comment:7 by Christian Boos, 12 years ago

Priority: highnormal

Looks like I forgot to push a crude workaround I had for this issue… [a0a40cb30265/mercurial-plugin].

Doing the follow part correctly is still TODO.

Modify Ticket

Change Properties
Set your email in Preferences
Action
as new The ticket will remain with no owner.
The ticket will be disowned.
as The resolution will be set. Next status will be 'closed'.
The owner will be changed from (none) to anonymous. Next status will be 'assigned'.

Add Comment


E-mail address and name can be saved in the Preferences .
 
Note: See TracTickets for help on using tickets.