Author: rey4
Date: 2006-04-23 14:53:00-0700
New Revision: 1346
Modified:
trunk/lib/vclib/__init__.py
trunk/lib/viewvc.py
trunk/templates/diff.ezt
trunk/templates/include/diff_form.ezt
trunk/viewvc.org/template-authoring-guide.html
trunk/viewvc.org/url-reference.html
Log:
Implement support for full diffs. Change based on a patch from
Jacob Nevins (sourceforge user "jtn") in issue 153.
* lib/vclib/__init__.py
(_diff_args): perform full diff when "context" option is None
* lib/viewvc.py
(view_diff): add logic for full diffs
* templates/diff.ezt
* templates/include/diff_form.ezt
add option for full diffs
* viewvc.org/template-authoring-guide.html
* viewvc.org/url-reference.html
update documentation for "diff_format" template variable and url param
Modified: trunk/lib/vclib/__init__.py
Url:
http://viewvc.tigris.org/source/browse/viewvc/trunk/lib/vclib/__init__.py?view=diff&rev=1346&p1=trunk/lib/vclib/__init__.py&p2=trunk/lib/vclib/__init__.py&r1=1345&r2=1346
==============================================================================
--- trunk/lib/vclib/__init__.py (original)
+++ trunk/lib/vclib/__init__.py 2006-04-23 14:53:00-0700
@@ -200,12 +200,18 @@
args = []
if type == CONTEXT:
if options.has_key('context'):
- args.append('--context=%i' % options['context'])
+ if options['context'] is None:
+ args.append('--context=-1')
+ else:
+ args.append('--context=%i' % options['context'])
else:
args.append('-c')
elif type == UNIFIED:
if options.has_key('context'):
- args.append('--unified=%i' % options['context'])
+ if options['context'] is None:
+ args.append('--unified=-1')
+ else:
+ args.append('--unified=%i' % options['context'])
else:
args.append('-u')
elif type == SIDE_BY_SIDE:
Modified: trunk/lib/viewvc.py
Url:
http://viewvc.tigris.org/source/browse/viewvc/trunk/lib/viewvc.py?view=diff&rev=1346&p1=trunk/lib/viewvc.py&p2=trunk/lib/viewvc.py&r1=1345&r2=1346
==============================================================================
--- trunk/lib/viewvc.py (original)
+++ trunk/lib/viewvc.py 2006-04-23 14:53:00-0700
@@ -2683,6 +2683,10 @@
diff_type = vclib.UNIFIED
diff_options['context'] = 15
human_readable = 1
+ elif format == 'f':
+ diff_type = vclib.UNIFIED
+ diff_options['context'] = None
+ human_readable = 1
elif format == 'h':
diff_type = vclib.UNIFIED
human_readable = 1
Modified: trunk/templates/diff.ezt
Url:
http://viewvc.tigris.org/source/browse/viewvc/trunk/templates/diff.ezt?view=diff&rev=1346&p1=trunk/templates/diff.ezt&p2=trunk/templates/diff.ezt&r1=1345&r2=1346
==============================================================================
--- trunk/templates/diff.ezt (original)
+++ trunk/templates/diff.ezt 2006-04-23 14:53:00-0700
@@ -195,6 +195,7 @@
<select name="diff_format" onchange="submit()">
<option value="h" [is diff_format
"h"]selected="selected"[end]>Colored Diff</option>
<option value="l" [is diff_format
"l"]selected="selected"[end]>Long Colored Diff</option>
+ <option value="f" [is diff_format
"f"]selected="selected"[end]>Full Colored Diff</option>
<option value="u" [is diff_format
"u"]selected="selected"[end]>Unidiff</option>
<option value="c" [is diff_format
"c"]selected="selected"[end]>Context Diff</option>
<option value="s" [is diff_format
"s"]selected="selected"[end]>Side by Side</option>
Modified: trunk/templates/include/diff_form.ezt
Url:
http://viewvc.tigris.org/source/browse/viewvc/trunk/templates/include/diff_form.ezt?view=diff&rev=1346&p1=trunk/templates/include/diff_form.ezt&p2=trunk/templates/include/diff_form.ezt&r1=1345&r2=1346
==============================================================================
--- trunk/templates/include/diff_form.ezt (original)
+++ trunk/templates/include/diff_form.ezt 2006-04-23 14:53:00-0700
@@ -55,6 +55,7 @@
<select name="diff_format" onchange="submit()">
<option value="h" [is diff_format "h"]selected="selected"[end]>Colored
Diff</option>
<option value="l" [is diff_format "l"]selected="selected"[end]>Long
Colored Diff</option>
+ <option value="f" [is diff_format "f"]selected="selected"[end]>Full
Colored Diff</option>
<option value="u" [is diff_format
"u"]selected="selected"[end]>Unidiff</option>
<option value="c" [is diff_format "c"]selected="selected"[end]>Context
Diff</option>
<option value="s" [is diff_format "s"]selected="selected"[end]>Side by
Side</option>
Modified: trunk/viewvc.org/template-authoring-guide.html
Url:
http://viewvc.tigris.org/source/browse/viewvc/trunk/viewvc.org/template-authoring-guide.html?view=diff&rev=1346&p1=trunk/viewvc.org/template-authoring-guide.html&p2=trunk/viewvc.org/template-authoring-guide.html&r1=1345&r2=1346
==============================================================================
--- trunk/viewvc.org/template-authoring-guide.html (original)
+++ trunk/viewvc.org/template-authoring-guide.html 2006-04-23 14:53:00-0700
@@ -607,7 +607,8 @@
<td class="varname">diff_format</td>
<td>String</td>
<td>Difference dislay format: Valid values are <tt>c</tt>
- (context), <tt>h</tt> (human-readable, or colored), <tt>l</tt> (long
+ (context), <tt>f</tt> (full human-readable),
+ <tt>h</tt> (human-readable, or colored), <tt>l</tt> (long
human-readable), <tt>s</tt> (side-by-side), <tt>u</tt>
(unified).</td>
</tr>
Modified: trunk/viewvc.org/url-reference.html
Url:
http://viewvc.tigris.org/source/browse/viewvc/trunk/viewvc.org/url-reference.html?view=diff&rev=1346&p1=trunk/viewvc.org/url-reference.html&p2=trunk/viewvc.org/url-reference.html&r1=1345&r2=1346
==============================================================================
--- trunk/viewvc.org/url-reference.html (original)
+++ trunk/viewvc.org/url-reference.html 2006-04-23 14:53:00-0700
@@ -377,7 +377,7 @@
<tr>
<td><code>diff_format=<var>DIFF_FORMAT</var></code></td>
<td>optional</td>
- <td>value specifying the type of diff to display. Can be "u" for unified
diff, "c" for context diff, "s" for side by side diff, "h" for human readable
diff, "l" for long human readable diff. If no value is specified the default
depends on the <code>diff_format</code> configuration option.
+ <td>value specifying the type of diff to display. Can be "u" for unified
diff, "c" for context diff, "s" for side by side diff, "h" for human readable
diff, "l" for long human readable diff, and "f" for a full human readable diff.
If no value is specified the default depends on the <code>diff_format</code>
configuration option.
</td>
</tr>
<tr>
|