Opened 13 months ago
Last modified 13 months ago
#13624 reopened defect
svn-browser generates wrong links directly after renaming/moving files
Reported by: | Owned by: | ||
---|---|---|---|
Priority: | normal | Milestone: | |
Component: | version control/browser | Version: | |
Severity: | normal | Keywords: | svn |
Cc: | Branch: | ||
Release Notes: | |||
API Changes: | |||
Internal Changes: |
Description
When moving a file in svn, directly after that the "Blame" and "Normal" links for files are wrong, they still refer to the name of the file before the renaming.
The following patch fixes that:
Index: trac/versioncontrol/web_ui/browser.py =================================================================== --- trac/versioncontrol/web_ui/browser.py (revision 17717) +++ trac/versioncontrol/web_ui/browser.py (working copy) @@ -479,7 +479,7 @@ add_ctxtnav(req, _('Normal'), title=_('View file without annotations'), href=req.href.browser(reponame, - node.created_path, + path, rev=rev)) if annotate != 'blame': add_ctxtnav(req, _('Blame'), @@ -487,7 +487,7 @@ 'changed revision ' '(this can be time consuming...)'), href=req.href.browser(reponame, - node.created_path, + path, rev=rev, annotate='blame')) add_ctxtnav(req, _('Revision Log'),
Attachments (0)
Change History (5)
comment:1 by , 13 months ago
Component: | general → version control/browser |
---|---|
Keywords: | svn added |
comment:2 by , 13 months ago
We are using a relatively old version, but the code in browser.py is the same as in current trac trunk.
comment:3 by , 13 months ago
Resolution: | → worksforme |
---|---|
Status: | new → closed |
Works on our environment. In [14384], trunk/trac/admin/templates/deploy_trac.wsgi
was renamed to trunk/trac/web/templates/deploy_trac.wsgi
. The navigation links are correct at source:/trunk/trac/web/templates/deploy_trac.wsgi@14384.
comment:4 by , 13 months ago
Do you have a file where the rename is the latest revision, not some revisions ago ? That's the case where it didn't work for me. Also the patch made sense to me, since "created_path" was still the path of the file as it was before the renaming.
comment:5 by , 13 months ago
Resolution: | worksforme |
---|---|
Status: | closed → reopened |
Can you, as a testcase, somewhere in trac svn, svn copy a directory just for testing purposes, and then in that throwaway-copy, svn mv some directory to a new name ? We renamed/moved directories, and after that the links for files were wrong.
Thanks for the reporting. What version of Trac are you using?