Edgewall Software

Opened 6 years ago

Last modified 6 years ago

#11777 closed defect

Raw revision of cached git repository in search view — at Version 1

Reported by: Jun Omae Owned by: Jun Omae
Priority: normal Milestone: 1.0.3
Component: version control Version: 0.12-stable
Severity: normal Keywords: search
Cc: Branch:
Release Notes:
API Changes:
Internal Changes:

Description (last modified by Jun Omae)

If searching changesets in cached git repository, the revisions are displayed with no changes. The issue doesn't occur if mercurial because search system requires revision table and mercurial connector doesn't support cache.

Both 0.12.x with th:GitPlugin and 1.0.x have this issue.

We should show shortened revisions in search view.

Patch for 1.0-stable:

  • trac/versioncontrol/web_ui/changeset.py

    diff --git a/trac/versioncontrol/web_ui/changeset.py b/trac/versioncontrol/web_ui/changeset.py
    index 097fe81..3225e4f 100644
    a b class ChangesetModule(Component):  
    11281128                    SELECT repos, rev, time, author, message
    11291129                    FROM revision WHERE """ + sql,
    11301130                    args):
    1131                 try:
    1132                     rev = int(rev)
    1133                 except ValueError:
    1134                     pass
    11351131                repos = repositories.get(id)
    11361132                if not repos:
    11371133                    continue # revisions for a no longer active repository
    11381134                cset = repos.resource.child('changeset', rev)
    11391135                if 'CHANGESET_VIEW' in req.perm(cset):
     1136                    try:
     1137                        drev = repos.display_rev(rev)
     1138                    except NoSuchChangeset:
     1139                        continue
    11401140                    yield (req.href.changeset(rev, repos.reponame or None),
    1141                            '[%s]: %s' % (rev, shorten_line(log)),
     1141                           '[%s]: %s' % (drev, shorten_line(log)),
    11421142                           from_utimestamp(ts), author,
    11431143                           shorten_result(log, terms))
    11441144

Change History (3)

by Jun Omae, 6 years ago

by Jun Omae, 6 years ago

comment:1 by Jun Omae, 6 years ago

Description: modified (diff)
Owner: set to Jun Omae
Status: newassigned
Note: See TracTickets for help on using tickets.