Edgewall Software
Modify

Opened 13 months ago

Last modified 13 months ago

#13624 reopened defect

svn-browser generates wrong links directly after renaming/moving files

Reported by: alexander.neundorf@… 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 Jun Omae, 13 months ago

Component: generalversion control/browser
Keywords: svn added

Thanks for the reporting. What version of Trac are you using?

comment:2 by alexander.neundorf@…, 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 Jun Omae, 13 months ago

Resolution: worksforme
Status: newclosed

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 alexander.neundorf@…, 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 alexander.neundorf@…, 13 months ago

Resolution: worksforme
Status: closedreopened

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.

Modify Ticket

Change Properties
Set your email in Preferences
Action
as reopened The ticket will remain with no owner.
The ticket will be disowned. Next status will be 'new'.
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.