* viewvc.py

(Request.run_viewvc): Select diff view for directories if r1/r2 arguments
  are provided.
  (view_revision): Generate a link to diff view on directories if there was
  a change in properties.

* log.ezt
  (revision links): Generate 'diff to previous' and 'diff to selected' for
  directories as well as files. Check for URL, not revision when determining
  if 'diff to previous' link should be created (for consistency with 'diff
  to selected')


git-svn-id: http://viewvc.tigris.org/svn/viewvc/branches/property-diff@2626 8cb11bc2-c004-0410-86c3-e597b4017df7
remotes/property-diff
stilor 2011-10-16 19:02:32 +00:00
parent 44a6fe7465
commit a789c13698
2 changed files with 10 additions and 11 deletions

View File

@ -343,6 +343,8 @@ class Request:
# ViewCVS 0.9.2 used to put ?tarball=1 at the end of tarball urls
if self.query_dict.has_key('tarball'):
self.view_func = download_tarball
elif self.query_dict.has_key('r1') and self.query_dict.has_key('r2'):
self.view_func = view_diff
else:
self.view_func = view_directory
elif self.pathtype == vclib.FILE:
@ -3821,7 +3823,8 @@ def view_revision(request):
params={'pathrev' : link_rev},
escape=1)
if change.pathtype is vclib.FILE and change.text_changed:
if (change.pathtype is vclib.FILE and change.text_changed) \
or change.props_changed:
change.diff_href = request.get_url(view_func=view_diff,
where=path,
pathtype=change.pathtype,

View File

@ -31,13 +31,11 @@
[if-any entries.download_text_href](<a href="[entries.download_text_href]">as text</a>)[end]
[if-any entries.annotate_href](<a href="[entries.annotate_href]">annotate</a>)[end]
[is pathtype "file"]
[# if you don't want to allow select for diffs then remove this section]
[is entries.rev rev_selected]
- <strong>[[]selected]</strong>
[else]
- <a href="[entries.sel_for_diff_href]">[[]select for diffs]</a>
[end]
[# if you don't want to allow select for diffs then remove this section]
[is entries.rev rev_selected]
- <strong>[[]selected]</strong>
[else]
- <a href="[entries.sel_for_diff_href]">[[]select for diffs]</a>
[end]
[end]
@ -105,8 +103,7 @@
[is entries.state "dead"]
<br /><strong><em>FILE REMOVED</em></strong>
[else]
[is pathtype "file"]
[if-any entries.prev]
[if-any entries.diff_to_prev_href]
<br />Diff to <a href="[entries.diff_to_prev_href]">previous [entries.prev]</a>
[if-any human_readable]
[else]
@ -140,7 +137,6 @@
(<a href="[entries.diff_to_sel_href]&amp;diff_format=h">colored</a>)
[end]
[end]
[end]
[end]
<pre class="vc_log">[entries.log]</pre>