diff --git a/trac/versioncontrol/admin.py b/trac/versioncontrol/admin.py
|
a
|
b
|
|
| 299 | 299 | if not info.get('alias'): |
| 300 | 300 | try: |
| 301 | 301 | repos = RepositoryManager(self.env).get_repository(reponame) |
| 302 | | info['rev'] = repos.get_youngest_rev() |
| | 302 | youngest_rev = repos.get_youngest_rev() |
| | 303 | info['rev'] = youngest_rev |
| | 304 | info['display_rev'] = repos.display_rev(youngest_rev) |
| 303 | 305 | except Exception: |
| 304 | 306 | pass |
| 305 | 307 | return info |
diff --git a/trac/versioncontrol/api.py b/trac/versioncontrol/api.py
|
a
|
b
|
|
| 856 | 856 | raise NotImplementedError |
| 857 | 857 | |
| 858 | 858 | def normalize_rev(self, rev): |
| 859 | | """Return a canonical representation of a revision. |
| | 859 | """Return a (unique) canonical representation of a revision. |
| 860 | 860 | |
| 861 | 861 | It's up to the backend to decide which string values of `rev` |
| 862 | 862 | (usually provided by the user) should be accepted, and how they |
| … |
… |
|
| 871 | 871 | def short_rev(self, rev): |
| 872 | 872 | """Return a compact representation of a revision in the repos.""" |
| 873 | 873 | return self.normalize_rev(rev) |
| | 874 | |
| | 875 | def display_rev(self, rev): |
| | 876 | """Return a representation of a revision in the repos for displaying to |
| | 877 | the user. |
| | 878 | |
| | 879 | This can be a shortened revision string, e.g. for repositories using |
| | 880 | long hashes. |
| | 881 | """ |
| | 882 | return self.normalize_rev(rev) |
| 874 | 883 | |
| 875 | 884 | def get_changes(self, old_path, old_rev, new_path, new_rev, |
| 876 | 885 | ignore_ancestry=1): |
diff --git a/trac/versioncontrol/templates/admin_repositories.html b/trac/versioncontrol/templates/admin_repositories.html
|
a
|
b
|
|
| 136 | 136 | <py:when test="info.dir">$info.prettydir</py:when> |
| 137 | 137 | <em py:otherwise="">Alias of $info.alias</em> |
| 138 | 138 | </td> |
| 139 | | <td><a py:if="info.rev" href="${href.changeset(info.rev, reponame) or None}">$info.rev</a></td> |
| | 139 | <td><a py:if="info.rev" href="${href.changeset(info.rev, reponame) or None}">$info.display_rev</a></td> |
| 140 | 140 | </tr> |
| 141 | 141 | </tbody> |
| 142 | 142 | </table> |
diff --git a/trac/versioncontrol/templates/browser.html b/trac/versioncontrol/templates/browser.html
|
a
|
b
|
|
| 106 | 106 | <table py:if="properties or file" id="info" summary="Revision info"> |
| 107 | 107 | <tr py:if="file"> |
| 108 | 108 | <th scope="col" i18n:msg="rev, size, author, date"> |
| 109 | | Revision <a href="${href.changeset(rev, reponame)}">$rev</a>, |
| | 109 | Revision <a href="${href.changeset(rev, reponame)}">${display_rev(rev)}</a>, |
| 110 | 110 | <span title="${_('%(size)s bytes', size=file.size)}">${pretty_size(file.size)}</span> |
| 111 | 111 | checked in by ${authorinfo(file.changeset.author)}, ${dateinfo(file.changeset.date)} ago |
| 112 | 112 | (<a href="${href.changeset(rev, reponame, created_path)}">diff</a>) |
diff --git a/trac/versioncontrol/templates/changeset.html b/trac/versioncontrol/templates/changeset.html
|
a
|
b
|
|
| 27 | 27 | log_href = href.log(reponame, new_path, rev=new_rev, stop_rev=old_rev); |
| 28 | 28 | new_href = href.browser(reponame, new_path, rev=new_rev); |
| 29 | 29 | old_href = href.browser(reponame, old_path, rev=old_rev); |
| | 30 | old_drev = display_rev(old_rev); |
| | 31 | new_drev = display_rev(new_rev); |
| 30 | 32 | "> |
| 31 | 33 | <py:when test="reponame"> |
| 32 | 34 | <py:choose> |
| 33 | 35 | <h1 py:when="changeset and restricted" i18n:msg="new_rev, reponame, new_path"> |
| 34 | | Changeset <a title="Show full changeset" href="cset_href">$new_rev</a> in $reponame |
| | 36 | Changeset <a title="Show full changeset" href="$cset_href">$new_drev</a> in $reponame |
| 35 | 37 | for <a title="Show entry in browser" href="$new_href">$new_path</a> |
| 36 | 38 | </h1> |
| 37 | 39 | <h1 py:when="not changeset and restricted" i18n:msg="new_path, old_rev, new_rev, reponame"> |
| 38 | 40 | Changes in <a title="Show entry in browser" href="$new_href">$new_path</a> |
| 39 | | <a title="Show revision log" href="$log_href">[$old_rev:$new_rev]</a> in $reponame |
| | 41 | <a title="Show revision log" href="$log_href">[$old_drev:$new_drev]</a> in $reponame |
| 40 | 42 | </h1> |
| 41 | 43 | <h1 py:when="not changeset and not restricted" i18n:msg="reponame, old_path, old_rev, new_path, new_rev"> |
| 42 | 44 | Changes in $reponame |
| 43 | 45 | from <a title="Show entry in browser" href="$old_href">$old_path</a> |
| 44 | | at <a title="Show full changeset" href="$old_cset_href">r$old_rev</a> |
| | 46 | at <a title="Show full changeset" href="$old_cset_href">r$old_drev</a> |
| 45 | 47 | to <a title="Show entry in browser" href="$new_href">$new_path</a> |
| 46 | | at <a title="Show full changeset" href="$cset_href">r$new_rev</a> |
| | 48 | at <a title="Show full changeset" href="$cset_href">r$new_drev</a> |
| 47 | 49 | </h1> |
| 48 | 50 | <h1 py:otherwise="" i18n:msg="new_rev, reponame"> |
| 49 | | Changeset <a py:strip="not annotated" href="$cset_href">$new_rev</a> in $reponame |
| | 51 | Changeset <a py:strip="not annotated" href="$cset_href">$new_drev</a> in $reponame |
| 50 | 52 | </h1> |
| 51 | 53 | </py:choose> |
| 52 | 54 | </py:when> |
| 53 | 55 | <py:otherwise> |
| 54 | 56 | <py:choose> |
| 55 | 57 | <h1 py:when="changeset and restricted" i18n:msg="new_rev, new_path"> |
| 56 | | Changeset <a title="Show full changeset" href="$cset_href">$new_rev</a> |
| | 58 | Changeset <a title="Show full changeset" href="$cset_href">$new_drev</a> |
| 57 | 59 | for <a title="Show entry in browser" href="$new_href">$new_path</a> |
| 58 | 60 | </h1> |
| 59 | 61 | <h1 py:when="not changeset and restricted" i18n:msg="new_path, old_rev, new_rev"> |
| 60 | 62 | Changes in <a title="Show entry in browser" href="$new_href">$new_path</a> |
| 61 | | <a title="Show revision log" href="$log_href">[$old_rev:$new_rev]</a> |
| | 63 | <a title="Show revision log" href="$log_href">[$old_drev:$new_drev]</a> |
| 62 | 64 | </h1> |
| 63 | 65 | <h1 py:when="not changeset and not restricted" i18n:msg="old_path, old_rev, new_path, new_rev"> |
| 64 | 66 | Changes |
| 65 | 67 | from <a title="Show entry in browser" href="$old_href">$old_path</a> |
| 66 | | at <a title="Show full changeset" href="$old_cset_href">r$old_rev</a> |
| | 68 | at <a title="Show full changeset" href="$old_cset_href">r$old_drev</a> |
| 67 | 69 | to <a title="Show entry in browser" href="$new_href">$new_path</a> |
| 68 | | at <a title="Show full changeset" href="$cset_href">r$new_rev</a> |
| | 70 | at <a title="Show full changeset" href="$cset_href">r$new_drev</a> |
| 69 | 71 | </h1> |
| 70 | 72 | <h1 py:otherwise="" i18n:msg="new_rev"> |
| 71 | | Changeset <a py:strip="not annotated" href="$cset_href">$new_rev</a> |
| | 73 | Changeset <a py:strip="not annotated" href="$cset_href">$new_drev</a> |
| 72 | 74 | </h1> |
| 73 | 75 | </py:choose> |
| 74 | 76 | </py:otherwise> |
| … |
… |
|
| 97 | 99 | <div class="$cl"> </div> |
| 98 | 100 | <py:choose> |
| 99 | 101 | <a py:when="is_removal" href="$item.old.href" |
| 100 | | title="${_('Show what was removed (content at revision %(old_rev)s)', old_rev=item.old.rev)}"> |
| | 102 | title="${_('Show what was removed (content at revision %(old_rev)s)', old_rev=display_rev(item.old.rev))}"> |
| 101 | 103 | $path |
| 102 | 104 | </a> |
| 103 | 105 | <a py:otherwise="" title="Show entry in browser" href="$item.new.href"> |
| … |
… |
|
| 108 | 110 | <py:if test="item.old and item.old.get('path') and item.change == 'copy' or item.change == 'move'"> |
| 109 | 111 | <small><em i18n:msg="kind, old_path"> |
| 110 | 112 | ($kind from <a href="$item.old.href" |
| 111 | | title="${_('Show original file (revision %(old_rev)s)', old_rev=item.old.rev)}"> |
| | 113 | title="${_('Show original file (revision %(old_rev)s)', old_rev=display_rev(item.old.rev))}"> |
| 112 | 114 | $item.old.path</a>) |
| 113 | 115 | </em></small> |
| 114 | 116 | </py:if> |
diff --git a/trac/versioncontrol/templates/dir_entries.html b/trac/versioncontrol/templates/dir_entries.html
|
a
|
b
|
|
| 16 | 16 | <span title="${_('%(size)s bytes', size=entry.content_length)}">${pretty_size(entry.content_length)}</span> |
| 17 | 17 | </td> |
| 18 | 18 | <td class="rev"> |
| 19 | | <a title="View Revision Log" href="${href.log(reponame, entry.path, rev=rev)}">$entry.rev</a> |
| | 19 | <a title="View Revision Log" href="${href.log(reponame, entry.path, rev=rev)}">${display_rev(entry.rev)}</a> |
| 20 | 20 | <a title="View Changeset" class="chgset" href="${href.changeset(change.rev, reponame)}"> </a> |
| 21 | 21 | </td> |
| 22 | 22 | <td class="age" style="${chgset_view and dir.timerange and 'border-color: rgb(%s,%s,%s)' % |
diff --git a/trac/versioncontrol/templates/path_links.html b/trac/versioncontrol/templates/path_links.html
|
a
|
b
|
|
| 28 | 28 | >$part.name</a><py:if test="not last" |
| 29 | 29 | ><span class="pathentry sep">/</span></py:if></py:with></py:for> |
| 30 | 30 | <!--! @ revision (FIXME check the data, this can sometimes be wrong) --> |
| 31 | | <py:if test="rev"><span class="pathentry sep">@</span> |
| | 31 | <py:if test="rev" py:with="drev = display_rev(rev)"><span class="pathentry sep">@</span> |
| 32 | 32 | <a class="pathentry" href="${href.changeset(rev, reponame)}" |
| 33 | | title="${_('View changeset %(rev)s', rev=rev)}">$rev</a> |
| | 33 | title="${_('View changeset %(rev)s', rev=drev)}">$drev</a> |
| 34 | 34 | </py:if> |
| 35 | 35 | <br style="clear: both" /> |
| 36 | 36 | |
diff --git a/trac/versioncontrol/templates/repository_index.html b/trac/versioncontrol/templates/repository_index.html
|
a
|
b
|
|
| 20 | 20 | <td class="size" /> |
| 21 | 21 | <td class="rev"> |
| 22 | 22 | <py:if test="not err"> |
| 23 | | <a title="View Revision Log" href="${href.log(repos.reponame)}">$change.rev</a> |
| | 23 | <a title="View Revision Log" href="${href.log(repos.reponame)}">${repos.display_rev(change.rev)}</a> |
| 24 | 24 | <a title="View Changeset" class="chgset" href="${href.changeset(change.rev, repos.reponame)}"> </a> |
| 25 | 25 | </py:if> |
| 26 | 26 | </td> |
diff --git a/trac/versioncontrol/templates/revisionlog.html b/trac/versioncontrol/templates/revisionlog.html
|
a
|
b
|
|
| 123 | 123 | <td class="diff"> |
| 124 | 124 | <input type="radio" name="old" value="${item.rev}@${item.path}" |
| 125 | 125 | checked="${idx == (len(items) - 1) or None}" |
| 126 | | title="${_('From r%(rev)s', rev=item.rev)}" /> |
| | 126 | title="${_('From [%(rev)s]', rev=display_rev(item.rev))}" /> |
| 127 | 127 | <input type="radio" name="new" value="${item.rev}@${item.path}" |
| 128 | 128 | checked="${idx == 0 or None}" |
| 129 | | title="${_('To r%(rev)s', rev=item.rev)}" /> |
| | 129 | title="${_('To [%(rev)s]', rev=display_rev(item.rev))}" /> |
| 130 | 130 | </td> |
| 131 | 131 | <py:when test="not is_separator"> |
| 132 | 132 | <td class="change" style="padding-left: ${item.depth}em"> |
| … |
… |
|
| 138 | 138 | </td> |
| 139 | 139 | <td class="rev"> |
| 140 | 140 | <a href="${href.browser(reponame, item.path, rev=item.existing_rev)}" |
| 141 | | title="${_('Browse at revision %(rev)s', rev=item.existing_rev)}"> |
| 142 | | @$item.existing_rev</a> |
| | 141 | title="${_('Browse at revision %(rev)s', rev=display_rev(item.existing_rev))}"> |
| | 142 | @${display_rev(item.existing_rev)}</a> |
| 143 | 143 | <py:choose test="item.change"> |
| 144 | 144 | <a py:when="'delete'" class="chgset" href="${href.changeset(item.rev)}" |
| 145 | | title="${_('View removal changeset [%(rev)s]', rev=item.rev)}"> </a> |
| | 145 | title="${_('View removal changeset [%(rev)s]', rev=display_rev(item.rev))}"> </a> |
| 146 | 146 | <a py:otherwise="" class="chgset" href="${href.changeset(item.rev, reponame, item.path)}" |
| 147 | 147 | title="${_('View changeset [%(rev)s] restricted to %(path)s', |
| 148 | | rev=item.rev, path=item.path)}"> </a> |
| | 148 | rev=display_rev(item.rev), path=item.path or '/')}"> </a> |
| 149 | 149 | </py:choose> |
| 150 | 150 | </td> |
| 151 | 151 | <td class="age" py:content="dateinfo(change.date)" /> |
diff --git a/trac/versioncontrol/templates/revisionlog.rss b/trac/versioncontrol/templates/revisionlog.rss
|
a
|
b
|
|
| 19 | 19 | item_context = context('changeset', change.rev, parent=repos.resource)"> |
| 20 | 20 | <xi:include href="author_or_creator.rss" py:with="author = change.author"/> |
| 21 | 21 | <pubDate>${http_date(change.date)}</pubDate> |
| 22 | | <title>Revision $item.rev: ${shorten_line(change.message)}</title> |
| | 22 | <title>Revision ${display_rev(item.rev)}: ${shorten_line(change.message)}</title> |
| 23 | 23 | <link>${abs_href.changeset(item.rev, reponame, item.path)}</link> |
| 24 | 24 | <guid isPermaLink="false">${abs_href.changeset(item.rev, reponame, item.path)}</guid> |
| 25 | 25 | <description py:with="m = change.message">${ |
diff --git a/trac/versioncontrol/templates/revisionlog.txt b/trac/versioncontrol/templates/revisionlog.txt
|
a
|
b
|
|
| 6 | 6 | |
| 7 | 7 | {% for item in items %}\ |
| 8 | 8 | {% with change = changes[item.rev]; extra = extra_changes[item.rev] %}\ |
| 9 | | ${http_date(change.date)} ${format_author(change.author)} [$item.rev] |
| | 9 | ${http_date(change.date)} ${format_author(change.author)} [${display_rev(item.rev)}] |
| 10 | 10 | {% for idx, file in enumerate(extra.files) %}\ |
| 11 | 11 | {% if 'FILE_VIEW' in perm(repos.resource.child('source', file, version=change.rev)) %}\ |
| 12 | 12 | * $file (${dict(edit='modified', add='added', delete='deleted', |
diff --git a/trac/versioncontrol/web_ui/browser.py b/trac/versioncontrol/web_ui/browser.py
|
a
|
b
|
|
| 356 | 356 | # Find node for the requested path/rev |
| 357 | 357 | context = Context.from_request(req) |
| 358 | 358 | node = None |
| | 359 | display_rev = lambda rev: rev |
| 359 | 360 | if repos: |
| 360 | 361 | try: |
| 361 | 362 | if rev: |
| … |
… |
|
| 370 | 371 | |
| 371 | 372 | context = context(repos.resource.child('source', path, |
| 372 | 373 | version=rev_or_latest)) |
| | 374 | display_rev = repos.display_rev |
| | 375 | |
| 373 | 376 | # Prepare template data |
| 374 | 377 | path_links = get_path_links(req.href, reponame, path, rev, |
| 375 | 378 | order, desc) |
| … |
… |
|
| 394 | 397 | 'context': context, 'reponame': reponame, 'repos': repos, |
| 395 | 398 | 'repoinfo': repoinfo, |
| 396 | 399 | 'path': path, 'rev': node and node.rev, 'stickyrev': rev, |
| | 400 | 'display_rev': display_rev, |
| 397 | 401 | 'created_path': node and node.created_path, |
| 398 | 402 | 'created_rev': node and node.created_rev, |
| 399 | 403 | 'properties': properties_data, |
| … |
… |
|
| 421 | 425 | href = req.href.browser(reponame, |
| 422 | 426 | node.created_path, rev=prev_rev) |
| 423 | 427 | add_link(req, 'prev', href, |
| 424 | | _('Revision %(num)s', num=prev_rev)) |
| | 428 | _('Revision %(num)s', num=display_rev(prev_rev))) |
| 425 | 429 | if rev is not None: |
| 426 | 430 | add_link(req, 'up', req.href.browser(reponame, |
| 427 | 431 | node.created_path)) |
| … |
… |
|
| 431 | 435 | href = req.href.browser(reponame, node.created_path, |
| 432 | 436 | rev=next_rev) |
| 433 | 437 | add_link(req, 'next', href, |
| 434 | | _('Revision %(num)s', num=next_rev)) |
| | 438 | _('Revision %(num)s', num=display_rev(next_rev))) |
| 435 | 439 | prevnext_nav(req, _('Previous Revision'), _('Next Revision'), |
| 436 | 440 | _('Latest Revision')) |
| 437 | 441 | else: |
diff --git a/trac/versioncontrol/web_ui/changeset.py b/trac/versioncontrol/web_ui/changeset.py
|
a
|
b
|
|
| 331 | 331 | rpath = new_path.replace('/','_') |
| 332 | 332 | if chgset: |
| 333 | 333 | if restricted: |
| 334 | | filename = 'changeset_%s_r%s' % (rpath, new) |
| | 334 | filename = 'changeset_%s_%s' % (rpath, new) |
| 335 | 335 | else: |
| 336 | | filename = 'changeset_r%s' % new |
| | 336 | filename = 'changeset_%s' % new |
| 337 | 337 | else: |
| 338 | 338 | if restricted: |
| 339 | | filename = 'diff-%s-from-r%s-to-r%s' \ |
| | 339 | filename = 'diff-%s-from-%s-to-%s' \ |
| 340 | 340 | % (rpath, old, new) |
| 341 | 341 | elif old_path == '/': # special case for download (#238) |
| 342 | | filename = '%s-r%s' % (rpath, old) |
| | 342 | filename = '%s-%s' % (rpath, old) |
| 343 | 343 | else: |
| 344 | | filename = 'diff-from-%s-r%s-to-%s-r%s' \ |
| | 344 | filename = 'diff-from-%s-%s-to-%s-%s' \ |
| 345 | 345 | % (old_path.replace('/','_'), old, rpath, new) |
| 346 | 346 | if format == 'diff': |
| 347 | 347 | self._render_diff(req, filename, repos, data) |
| … |
… |
|
| 381 | 381 | def _render_html(self, req, repos, chgset, restricted, xhr, data): |
| 382 | 382 | """HTML version""" |
| 383 | 383 | data['restricted'] = restricted |
| | 384 | display_rev = repos.display_rev |
| | 385 | data['display_rev'] = display_rev |
| 384 | 386 | browser = BrowserModule(self.env) |
| 385 | 387 | reponame = repos.reponame or None |
| 386 | 388 | |
| … |
… |
|
| 406 | 408 | yield old_node, new_node, kind, change |
| 407 | 409 | |
| 408 | 410 | def _changeset_title(rev): |
| | 411 | rev = display_rev(rev) |
| 409 | 412 | if restricted: |
| 410 | 413 | return _('Changeset %(id)s for %(path)s', id=rev, |
| 411 | 414 | path=path) |
| … |
… |
|
| 436 | 439 | else: |
| 437 | 440 | add_link(req, 'first', |
| 438 | 441 | req.href.changeset(oldest_rev, reponame), |
| 439 | | _('Changeset %(id)s', id=oldest_rev)) |
| | 442 | _('Changeset %(id)s', id=display_rev(oldest_rev))) |
| 440 | 443 | prev_path = data['old_path'] |
| 441 | 444 | prev_rev = repos.previous_rev(chgset.rev) |
| 442 | 445 | if prev_rev: |
| … |
… |
|
| 457 | 460 | else: |
| 458 | 461 | add_link(req, 'last', |
| 459 | 462 | req.href.changeset(youngest_rev, reponame), |
| 460 | | _('Changeset %(id)s', id=youngest_rev)) |
| | 463 | _('Changeset %(id)s', |
| | 464 | id=display_rev(youngest_rev))) |
| 461 | 465 | next_rev = repos.next_rev(chgset.rev) |
| 462 | 466 | if next_rev: |
| 463 | 467 | next_href = req.href.changeset(next_rev, reponame) |
| … |
… |
|
| 484 | 488 | reponame, node.created_path, rev=node.created_rev, |
| 485 | 489 | annotate=annotated and 'blame' or None) |
| 486 | 490 | title = _('Show revision %(rev)s of this file in browser', |
| 487 | | rev=node.rev) |
| | 491 | rev=display_rev(node.rev)) |
| 488 | 492 | return {'path': node.path, 'rev': node.rev, |
| 489 | 493 | 'shortrev': repos.short_rev(node.rev), |
| 490 | 494 | 'href': href, 'title': title} |
| … |
… |
|
| 630 | 634 | href = req.href.changeset(new_node.rev, reponame, |
| 631 | 635 | new_node.path) |
| 632 | 636 | title = _('Show the changeset %(id)s restricted to ' |
| 633 | | '%(path)s', id=new_node.rev, |
| | 637 | '%(path)s', id=display_rev(new_node.rev), |
| 634 | 638 | path=new_node.path) |
| 635 | 639 | else: |
| 636 | 640 | href = req.href.changeset( |
| … |
… |
|
| 640 | 644 | old_path=pathjoin(repos.reponame, |
| 641 | 645 | old_node.created_path)) |
| 642 | 646 | title = _('Show the %(range)s differences restricted ' |
| 643 | | 'to %(path)s', range='r%s:%s' % ( |
| 644 | | old_node.rev, new_node.rev), |
| | 647 | 'to %(path)s', range='[%s:%s]' % ( |
| | 648 | display_rev(old_node.rev), |
| | 649 | display_rev(new_node.rev)), |
| 645 | 650 | path=new_node.path) |
| 646 | 651 | info['href'] = href |
| 647 | 652 | info['title'] = old_node and title |
| … |
… |
|
| 782 | 787 | def title_for_diff(self, data): |
| 783 | 788 | if data['new_path'] == data['old_path']: |
| 784 | 789 | # ''diff between 2 revisions'' mode |
| 785 | | return 'Diff r%s:%s for %s' \ |
| | 790 | return 'Diff [%s:%s] for %s' \ |
| 786 | 791 | % (data['old_rev'] or 'latest', data['new_rev'] or 'latest', |
| 787 | 792 | data['new_path'] or '/') |
| 788 | 793 | else: |
| … |
… |
|
| 999 | 1004 | single and 1 or 2, repo=', '.join(repos_for_uid)) |
| 1000 | 1005 | else: |
| 1001 | 1006 | title = ngettext('Changeset ', 'Changesets ', single and 1 or 2) |
| | 1007 | drev_a = older_cset.repos.display_rev(rev_a) |
| 1002 | 1008 | if single: |
| 1003 | | title = tag(title, tag.em('[%s]' % rev_a)) |
| | 1009 | title = tag(title, tag.em('[%s]' % drev_a)) |
| 1004 | 1010 | else: |
| 1005 | | title = tag(title, tag.em('[%s-%s]' % (rev_a, rev_b))) |
| | 1011 | drev_b = cset.repos.display_rev(rev_b) |
| | 1012 | title = tag(title, tag.em('[%s-%s]' % (drev_a, drev_b))) |
| 1006 | 1013 | if field == 'title': |
| 1007 | 1014 | return title |
| 1008 | 1015 | elif field == 'summary': |
diff --git a/trac/versioncontrol/web_ui/log.py b/trac/versioncontrol/web_ui/log.py
|
a
|
b
|
|
| 104 | 104 | rev = revranges.b |
| 105 | 105 | except ValueError: |
| 106 | 106 | pass |
| 107 | | rev = unicode(repos.normalize_rev(rev)) |
| | 107 | rev = unicode(repos.normalize_rev(rev)) |
| | 108 | display_rev = repos.display_rev |
| 108 | 109 | |
| 109 | 110 | # The `history()` method depends on the mode: |
| 110 | 111 | # * for ''stop on copy'' and ''follow copies'', it's `Node.history()` |
| … |
… |
|
| 195 | 196 | # FIXME: we should send a 404 error here |
| 196 | 197 | raise TracError(_("The file or directory '%(path)s' doesn't " |
| 197 | 198 | "exist at revision %(rev)s or at any previous revision.", |
| 198 | | path=path, rev=rev), _('Nonexistent path')) |
| | 199 | path=path, rev=display_rev(rev)), _('Nonexistent path')) |
| 199 | 200 | |
| 200 | 201 | def make_log_href(path, **args): |
| 201 | 202 | link_rev = rev |
| … |
… |
|
| 223 | 224 | revs=next_revranges) |
| 224 | 225 | add_link(req, 'next', older_revisions_href, |
| 225 | 226 | _('Revision Log (restarting at %(path)s, rev. %(rev)s)', |
| 226 | | path=next_path, rev=next_rev)) |
| | 227 | path=next_path, rev=display_rev(next_rev))) |
| 227 | 228 | # only show fully 'limit' results, use `change == None` as a marker |
| 228 | 229 | info[-1]['change'] = None |
| 229 | 230 | |
| … |
… |
|
| 258 | 259 | 'context': Context.from_request(req, 'source', path, |
| 259 | 260 | parent=repos.resource), |
| 260 | 261 | 'reponame': repos.reponame or None, 'repos': repos, |
| 261 | | 'path': path, 'rev': rev, 'stop_rev': stop_rev, |
| 262 | | 'revranges': revranges, |
| | 262 | 'path': path, 'rev': rev, 'stop_rev': stop_rev, |
| | 263 | 'display_rev': display_rev, 'revranges': revranges, |
| 263 | 264 | 'mode': mode, 'verbose': verbose, 'limit' : limit, |
| 264 | 265 | 'items': info, 'changes': changes, |
| 265 | 266 | 'email_map': email_map, 'extra_changes': extra_changes, |
diff --git a/trac/versioncontrol/web_ui/tests/wikisyntax.py b/trac/versioncontrol/web_ui/tests/wikisyntax.py
|
a
|
b
|
|
| 231 | 231 | <p> |
| 232 | 232 | <a class="changeset" href="/changeset?new_path=branch&old_path=trunk" title="Diff from trunk@latest to branch@latest">diff:trunk//branch</a> |
| 233 | 233 | <a class="changeset" href="/changeset?new=23&new_path=branch&old=12&old_path=trunk" title="Diff from trunk@12 to branch@23">diff:trunk@12//branch@23</a> |
| 234 | | <a class="changeset" href="/changeset?new=23&new_path=trunk&old=12&old_path=trunk" title="Diff r12:23 for trunk">diff:trunk@12:23</a> |
| 235 | | <a class="changeset" href="/changeset?new=23&old=12" title="Diff r12:23 for /">diff:@12:23</a> |
| | 234 | <a class="changeset" href="/changeset?new=23&new_path=trunk&old=12&old_path=trunk" title="Diff [12:23] for trunk">diff:trunk@12:23</a> |
| | 235 | <a class="changeset" href="/changeset?new=23&old=12" title="Diff [12:23] for /">diff:@12:23</a> |
| 236 | 236 | </p> |
| 237 | 237 | ------------------------------ |
| 238 | 238 | ============================== diff: link resolver + query |
| … |
… |
|
| 246 | 246 | diff:// |
| 247 | 247 | ------------------------------ |
| 248 | 248 | <p> |
| 249 | | <a class="changeset" title="Diff rlatest:latest for /">diff://</a> |
| | 249 | <a class="changeset" title="Diff [latest:latest] for /">diff://</a> |
| 250 | 250 | </p> |
| 251 | 251 | ------------------------------ |
| 252 | 252 | """ |