Edgewall Software
Modify

Opened 7 years ago

Closed 7 years ago

#12655 closed defect (fixed)

BrowserModule displays wrong author in SVN keywords on HEAD Revision

Reported by: markusbloch@… Owned by: Jun Omae
Priority: normal Milestone: 1.0.14
Component: version control Version: 1.2
Severity: normal Keywords: svn:keywords
Cc: Branch:
Release Notes:

Fixed substitution for author in svn:keywords.

API Changes:
Internal Changes:

Description (last modified by Jun Omae)

Hello,

I'm responsible for the Trac environment located at https://svn.fhem.de/trac/

We're using only the BrowserModule to display our SVN repository.

The $Id$ replacement always contains the wrong author when opening the file content in HEAD revision.

Example: The following file was last modified by me (markusbloch) at revision 11987, but the displayed author in $Id$ contains the author name of the latest revision HEAD and not revision 11987 (were this file was last modified)

my file: https://svn.fhem.de/trac/browser/trunk/fhem/FHEM/98_version.pm HEAD author: https://svn.fhem.de/trac/changeset/HEAD/

Only when explicitly selecting my file at revision 11987, the author is displayed correctly: https://svn.fhem.de/trac/browser/trunk/fhem/FHEM/98_version.pm?rev=11987

So when browing the repository, all files were displayed by Trac with the author name of the latest commit (HEAD) no matter if the file was modified during the latest commit or not.

This problem also occurs when using the ZIP download functionality for trunk. All files contains $Id$ with the author of the latest commit.

Our project relies on correct $Id$ replacement, because we have about 60 developers, were each is commiting changes to specific files only. The developed application uses the author names from $Id$.

The problem could be verified on Trac 1.0.2 (used at svn.fhem.de) and latest Trac 1.2 (virtual machine on my laptop)

Please use the correct author name of the last change revision per file and not the author name of HEAD revision.

Please let me know, if I can help you.

Kind Regards

Markus Bloch

Attachments (2)

trac wrong username in Id.png (56.3 KB ) - added by markusbloch@… 7 years ago.
wrong author name
trac correct username in Id at revision.png (58.0 KB ) - added by markusbloch@… 7 years ago.
correct username

Download all attachments as: .zip

Change History (10)

comment:1 by markusbloch@…, 7 years ago

I wanted to attach some screenshots for clarification but your Trac (trac.edgewall.org) raises an error when click on file upload.

IndexError: pop from empty list

GET: /attachment/ticket/12655/
Last edited 7 years ago by Ryan J Ollos (previous) (diff)

comment:2 by anonymous, 7 years ago

Description: modified (diff)

in reply to:  1 ; comment:3 by Jun Omae, 7 years ago

Description: modified (diff)
Keywords: svn:keywords added; svn browser author removed
Milestone: undecidednext-stable-1.0.x

Replying to markusbloch@…:

I wanted to attach some screenshots for clarification but your Trac (trac.edgewall.org) raises an error when click on file upload.

That's #11184. Please try to upload with English language.

by markusbloch@…, 7 years ago

wrong author name

by markusbloch@…, 7 years ago

correct username

in reply to:  3 comment:4 by Markus Bloch <markusbloch@…>, 7 years ago

Replying to Jun Omae:

Replying to markusbloch@…:

I wanted to attach some screenshots for clarification but your Trac (trac.edgewall.org) raises an error when click on file upload.

That's #11184. Please try to upload with English language.

Thank you, now it works. I attached the mentioned screenshots.

comment:5 by Jun Omae, 7 years ago

Could you please try the following patch?

  • tracopt/versioncontrol/svn/svn_fs.py

    diff --git a/tracopt/versioncontrol/svn/svn_fs.py b/tracopt/versioncontrol/svn/svn_fs.py
    index 44ddab4c4..76ea19416 100644
    a b class FileContentStream(object):  
    12061206            return self._read_substitute(self.stream, n)
    12071207
    12081208    def _get_revprop(self, name):
    1209         return fs.revision_prop(self.fs_ptr, self.node.rev, name, self.pool())
     1209        return fs.revision_prop(self.fs_ptr, self.node.created_rev, name,
     1210                                self.pool())
    12101211
    12111212    def _split_keywords(self, keywords):
    12121213        return filter(None, self.KEYWORD_SPLIT_RE.split(keywords or ''))

in reply to:  5 comment:6 by Markus Bloch <markusbloch@…>, 7 years ago

Replying to Jun Omae:

Could you please try the following patch?

  • tracopt/versioncontrol/svn/svn_fs.py

    diff --git a/tracopt/versioncontrol/svn/svn_fs.py b/tracopt/versioncontrol/svn/svn_fs.py
    index 44ddab4c4..76ea19416 100644
    a b class FileContentStream(object):  
    12061206            return self._read_substitute(self.stream, n)
    12071207
    12081208    def _get_revprop(self, name):
    1209         return fs.revision_prop(self.fs_ptr, self.node.rev, name, self.pool())
     1209        return fs.revision_prop(self.fs_ptr, self.node.created_rev, name,
     1210                                self.pool())
    12101211
    12111212    def _split_keywords(self, keywords):
    12121213        return filter(None, self.KEYWORD_SPLIT_RE.split(keywords or ''))

I applied the patch and it works now perfectly, thanks a lot.

comment:7 by Jun Omae, 7 years ago

Milestone: next-stable-1.0.x1.0.14
Owner: set to Jun Omae
Status: newassigned

Thanks for the feedback! I'll apply it with unit tests to 1.0-stable branch.

comment:8 by Jun Omae, 7 years ago

Release Notes: modified (diff)
Resolution: fixed
Status: assignedclosed

Fixed in [15342] and merged in [15343-15344].

Modify Ticket

Change Properties
Set your email in Preferences
Action
as closed The owner will remain Jun Omae.
The resolution will be deleted. Next status will be 'reopened'.
to The owner will be changed from Jun Omae to the specified user.

Add Comment


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