Opened 12 years ago
Last modified 9 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 , 12 years ago
comment:4 by , 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 , 12 years ago
While waiting for a fix in Mercurial itself, one can apply the following patch to mercurial:
-
mercurial/cmdutil.py
old new 996 996 revs = scmutil.revrange(repo, opts['rev'] or [defrange]) 997 997 if not revs: 998 998 return [] 999 pctx = repo[revs[0]] 999 1000 wanted = set() 1000 1001 slowpath = match.anypats() or (match.files() and opts.get('removed')) 1001 1002 fncache = {} … … 1044 1045 1045 1046 return reversed(revs) 1046 1047 def iterfiles(): 1047 pctx = repo['.']1048 1048 for filename in match.files(): 1049 1049 if follow: 1050 1050 if filename not in pctx:
comment:6 by , 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 , 12 years ago
Priority: | high → normal |
---|
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.
The check which fails was apparently added here:
http://selenic.com/pipermail/mercurial-devel/2012-February/038249.html