Commit Graph

273 Commits (f48add83f7d3ee999dc582312f9b3afc7fdb2a5c)

Author SHA1 Message Date
cmpilato f48add83f7 Bump copyright years.
git-svn-id: http://viewvc.tigris.org/svn/viewvc/trunk@2820 8cb11bc2-c004-0410-86c3-e597b4017df7
2013-01-04 19:01:54 +00:00
cmpilato b57831ade8 Fix the handling of diff options throughout.
* lib/viewvc.py
  (DiffDescription.__init__): Don't set self.diff_options.
  (DiffDescription.get_content_diff, DiffDescription.get_prop_diff):
    Rename local variable 'options' to 'diff_options', and actually
    populate *it* rather than the otherwise unused (and now removed)
    'diff_options' class variable.
  (DiffDescription._get_diff, DiffDescription._line_idiff_sidebyside,
   DiffDescription._line_idiff_unified, DiffDescription._content_fp,
   DiffDescription._prop_fp): Rename 'options' to 'diff_options'.


git-svn-id: http://viewvc.tigris.org/svn/viewvc/trunk@2818 8cb11bc2-c004-0410-86c3-e597b4017df7
2012-10-25 20:21:13 +00:00
cmpilato 19818e269c * lib/viewvc.py
(view_patch): Honor the "show functions" option when generating
    patches, too.


git-svn-id: http://viewvc.tigris.org/svn/viewvc/trunk@2817 8cb11bc2-c004-0410-86c3-e597b4017df7
2012-10-25 20:14:16 +00:00
cmpilato dcb7e17dc6 Fix issue #516 ("Regression: UnboundLocalError: local variable
'log_pagestart' referenced before assignment").

* lib/viewvc.py
  (view_log): Initialize the 'log_pagestart' variable.

git-svn-id: http://viewvc.tigris.org/svn/viewvc/trunk@2808 8cb11bc2-c004-0410-86c3-e597b4017df7
2012-10-25 13:46:15 +00:00
cmpilato de517ae29c Fix issue #515 ("XSS bug in diff view (CVE-2012-4533)").
* lib/viewvc.py
  (DiffSource._get_row): Pass the "extra" line information through the
    formatter code so that, at a minimum, it's HTML-escaped.

Patch by: Nicolás Alvarez <nicolas.alvarez{__AT__}gmail.com>


git-svn-id: http://viewvc.tigris.org/svn/viewvc/trunk@2792 8cb11bc2-c004-0410-86c3-e597b4017df7
2012-10-24 13:26:36 +00:00
cmpilato f4945fd7d9 Oops! Fix the diff view I broke in r2784.
* lib/viewvc.py
  (view_diff): Add 'cfg' convenience variable (to avoid a stack trace
    caused by using such a thing a few lines later).


git-svn-id: http://viewvc.tigris.org/svn/viewvc/trunk@2790 8cb11bc2-c004-0410-86c3-e597b4017df7
2012-10-03 14:33:38 +00:00
cmpilato 4590ebbd6b Fix issue #512 ("'Select for diffs' does not work across pages").
* lib/viewvc.py
  (view_log): Preserve the 'log_pagestart' query value when generating
    the 'select for diff' links so that clicking the link returns you to
    the same page (modulo repagination due to new commits in the race
    window ... but let's not think about that).  Also, preserve the
    'r1' query parameter when generating the paging form.


git-svn-id: http://viewvc.tigris.org/svn/viewvc/trunk@2788 8cb11bc2-c004-0410-86c3-e597b4017df7
2012-10-03 14:22:48 +00:00
cmpilato 00feefc3dc Finish issue #510 ("Block the expensive display of binary files").
Add a new configuration option 'binary_mime_types' which accepts a
comma-delimited list of MIME content type patterns ('text/plain', or
'image/*', etc.) against which versioned file MIME types are
compared for the purposes of deciding whether to allow their display
in the 'markup', 'annotate', 'diff' and 'patch' views.

* conf/viewvc.conf.dist
  (binary_mime_types): Describe new option.

* lib/config.py
  (_force_multi_value): Add 'binary_file_types' to the list of
    multi-value options.
  (Config.set_defaults): Initialize cfg.options.binary_mime_types.

* lib/viewvc.py
  (is_binary_file_mime_type): New function.
  (get_file_view_info): Use is_binary_file_mime_type() to determine
    whether to return links to content-ful views of the input file.
  (markup_or_annotate, view_diff): Use is_binary_file_mime_type() to
    deny display of so-deemed binary files.



git-svn-id: http://viewvc.tigris.org/svn/viewvc/trunk@2784 8cb11bc2-c004-0410-86c3-e597b4017df7
2012-09-05 12:55:19 +00:00
cmpilato 698e9db4f2 * lib/viewvc.py
(LogFormatter.get): Fix a regression introduced in 1.1.14's handling
    of log messages when not HTML-ifying them (for example, when serving
    them up via RSS).

Patch by: Christoph Sommer <christoph.sommer{__AT__}uibk.ac.at>


git-svn-id: http://viewvc.tigris.org/svn/viewvc/trunk@2771 8cb11bc2-c004-0410-86c3-e597b4017df7
2012-06-19 18:45:36 +00:00
cmpilato 163f63ed15 Fix some breakage in the annotate view for remote SVN repositories.
* lib/viewvc.py
  (markup_or_annotate): Don't forget to cross copies when requesting
    the item's log.

* lib/vclib/svn/svn_ra.py
  (RemoteSubversionRepository.itemlog): Treat 'svn_latest_log' option
    specially, as in the svn_repos case.  (Ugh.)
  (RemoteSubversionRepository.annotate): Pass 'svn_show_all_dir_logs'
    option to itemlog().  Also, upgrade to svn_client_blame2() API.
  (RemoteSubversionRepository._get_last_history_rev): Now return both
    the info-provided create_rev, and the more accurate
    last_history_rev.  Callers updated.


git-svn-id: http://viewvc.tigris.org/svn/viewvc/trunk@2770 8cb11bc2-c004-0410-86c3-e597b4017df7
2012-06-19 15:26:41 +00:00
cmpilato bfe2cbe5ca Fix issue #246 ("Add support for issue tracker links in commit-log
viewer").

NOTE: There are some limitations here, most prominantly that commas
can't be used in the regular expressions which define replacements,
and that only match groupings 0-9 can be used in the replacement
format string.

* conf/viewvc.conf.dist
  (custom_log_formatting): New configuration option.

* lib/config.py
  (Config._force_multi_value, Config.set_defaults): Add handling of
    new 'custom_log_formatting' option.

* lib/viewvc.py
  (ViewVCHtmlFormatter.format_custom_url): New formatter callback.
  (LogFormatter.get): Register the new formatter callback for rules
    found in the 'custom_log_formatting' option value.


git-svn-id: http://viewvc.tigris.org/svn/viewvc/trunk@2746 8cb11bc2-c004-0410-86c3-e597b4017df7
2012-06-12 11:11:18 +00:00
cmpilato 9d75ed19f8 Finish issue #506 ("Log message tokenization results could be reused
for better performance").

* lib/viewvc.py
  Replace uses of format_log() throughout with calls to LogFormatter()
  (to get a formatter "lf") then lf.get() (to get the formatted log
  string).  Also...
  (format_log): Remove as unused.


git-svn-id: http://viewvc.tigris.org/svn/viewvc/trunk@2741 8cb11bc2-c004-0410-86c3-e597b4017df7
2012-04-17 15:29:27 +00:00
cmpilato f65b03fcdc For issue #506 ("Log message tokenization results could be reused for
better performance"), make the first step of two in trying to avoid
parsing log messages twice when once will suffice.

* lib/viewvc.py
  (ViewVCHtmlFormatterTokens): New class for generating HTML-formatted
    text from a set of provided ViewVCHtmlFormatter tokens.
  (ViewVCHtmlFormatter.get_result): Track renamed function, and defer
    the work of the text generation to the token object's get_result()
    method.
  (ViewVCHtmlFormatter.tokenize_text): Renamed from _tokenize_text(),
    and now return a ViewVCHtmlFormatterTokens object.
  (LogFormatter): New class for encapsulating the log formatting logic.
  (format_log): Make a wrapper around LogFormatter for now.


git-svn-id: http://viewvc.tigris.org/svn/viewvc/trunk@2740 8cb11bc2-c004-0410-86c3-e597b4017df7
2012-04-17 15:25:56 +00:00
cmpilato 9e9b82218c Bump copyright years.
git-svn-id: http://viewvc.tigris.org/svn/viewvc/trunk@2720 8cb11bc2-c004-0410-86c3-e597b4017df7
2012-01-23 17:52:47 +00:00
cmpilato 6fe390a642 Move a customization out of ezt.py to eliminate unnecessary deltas
against the upstream version of this module.

* lib/common.py
  (TemplateData): Moved here...

* lib/ezt.py
  ...from here.

* lib/query.py,
* lib/viewvc.py
  Import 'TemplateData' from 'common' now, and update references to this
  relocated class.

git-svn-id: http://viewvc.tigris.org/svn/viewvc/trunk@2711 8cb11bc2-c004-0410-86c3-e597b4017df7
2012-01-04 15:35:12 +00:00
cmpilato 1dd1a21537 * lib/viewvc.py
(): Stop importing the pygments stuff at the module-global scope,
    and go back to doing so...
  (markup_stream): ...here.
  (markup_or_annotate): No longer consider access to Pygments when
    making the first pass at colorizing -- if we don't have it,
    markup_stream() will fail quickly and we can take the second
    (non-colorizing) pass.


git-svn-id: http://viewvc.tigris.org/svn/viewvc/trunk@2702 8cb11bc2-c004-0410-86c3-e597b4017df7
2011-12-12 20:01:30 +00:00
cmpilato a03cd82de5 On the 'issue-495-dev' branch, make what I think are some pretty
useful improvements to the syntax coloration and annotation codepaths.
First, settle on the file contents as fetched via repos.openfile() as
the canonical source of such.  But also, allow any exceptions thrown
while colorizing those file contents to trigger a second attempt
without colorization enabled.  This should allow for non-error-ful
display of binary files which lack both an extension and VC content
type hint (those are treated by default as text files).

* lib/viewvc.py
  (markup_stream): Add docstring.  Replace 'fp' parameter with
    'file_lines' parameter.  Add 'colorize' parameter.  No longer try
    to munge 'blame_data' -- expect that callers have done that.  Lose
    first_line tracking stuff, as fetching the first line of the file
    is no longer destructive.  Always use 'file_lines' as the source
    of file contents; never the text attached to the 'blame-data'.
  (markup_or_annotate): Rework this to do more of the cheap work of
    annotating and markup up so that markup_stream() can be called
    more than once if necessary -- once to attempt colorization, and
    again without that feature if the first pass fails.


git-svn-id: http://viewvc.tigris.org/svn/viewvc/branches/issue-495-dev@2698 8cb11bc2-c004-0410-86c3-e597b4017df7
2011-12-05 21:11:29 +00:00
cmpilato 2f722f39b9 On the 'issue-495-dev' branch:
* lib/viewvc.py
  (markup_stream): Was markup_stream_pygments().  Caller changed.


git-svn-id: http://viewvc.tigris.org/svn/viewvc/branches/issue-495-dev@2695 8cb11bc2-c004-0410-86c3-e597b4017df7
2011-12-05 18:31:55 +00:00
cmpilato 402dfd831f On the 'issue-495-dev' branch:
* lib/viewvc.py
  (markup_stream_pygments): Remove level of indentation made
    unnecessary by r2693.


git-svn-id: http://viewvc.tigris.org/svn/viewvc/branches/issue-495-dev@2694 8cb11bc2-c004-0410-86c3-e597b4017df7
2011-12-05 18:30:50 +00:00
cmpilato 738d17f71f On the 'issue-495-dev' branch:
* lib/viewvc.py
  (): Try to import the pygments code at the global scope instead of...
  (markup_stream_pygments): ...here.  Add/move some comments, too.


git-svn-id: http://viewvc.tigris.org/svn/viewvc/branches/issue-495-dev@2693 8cb11bc2-c004-0410-86c3-e597b4017df7
2011-12-05 18:28:05 +00:00
cmpilato db032720a8 On the 'issue-495-dev' branch: Re-apply the most recently committed
(then reverted) bits of the issue #495 work.

* lib/viewvc.py (markup_stream_pygments)

git-svn-id: http://viewvc.tigris.org/svn/viewvc/branches/issue-495-dev@2691 8cb11bc2-c004-0410-86c3-e597b4017df7
2011-12-02 19:48:24 +00:00
cmpilato b42a4a0915 * lib/viewvc.py
(markup_or_annotate): Don't show annotation warnings for markup
    views of images.


git-svn-id: http://viewvc.tigris.org/svn/viewvc/trunk@2688 8cb11bc2-c004-0410-86c3-e597b4017df7
2011-12-02 18:35:01 +00:00
cmpilato d2275afb6d * lib/viewvc.py
(markup_stream_pygments): Re-make the semantic changes from r2680,
    which were (I believe) good ones, even if the lexer guessing stuff
    hasn't yet work out entirely.

git-svn-id: http://viewvc.tigris.org/svn/viewvc/trunk@2686 8cb11bc2-c004-0410-86c3-e597b4017df7
2011-12-02 18:18:23 +00:00
cmpilato 5db50e6bcc Revert r2657, r2680, and r2681, effectively removing support for
Pygments' lexer guessing functionality (closing the REOPENED bug issue
#501, and necessitating that feature issue #495 be itself REOPENED).


git-svn-id: http://viewvc.tigris.org/svn/viewvc/trunk@2684 8cb11bc2-c004-0410-86c3-e597b4017df7
2011-12-02 17:51:41 +00:00
cmpilato e8a0caeef5 *** THIS REVISION WAS REVERTED IN r2684 ***
For issue #501 ("Stack trace when trying to 'view' binary files"):

* lib/viewvc.py
  (markup_stream_pygments): On second thought, allow guessing to
    happen on non-None MIME types iff they appear to be text-y.


git-svn-id: http://viewvc.tigris.org/svn/viewvc/trunk@2681 8cb11bc2-c004-0410-86c3-e597b4017df7
2011-11-29 15:33:20 +00:00
cmpilato dfeb3b5d90 *** THIS REVISION WAS REVERTED IN r2684 ***
For issue #501 ("Stack trace when trying to 'view' binary files"):

* lib/viewvc.py
  (markup_stream_pygments): Rework the Pygments lexer-choosing logic a
    bit.  First, don't try any of it when syntax highlighting is
    disabled.  Secondly, don't guess at a lexer if we know the file's
    MIME type and have already failed to get a matching lexer.


git-svn-id: http://viewvc.tigris.org/svn/viewvc/trunk@2680 8cb11bc2-c004-0410-86c3-e597b4017df7
2011-11-29 15:25:00 +00:00
cmpilato 5943e01304 * lib/viewvc.py
(markup_or_annotate): Pass 'mime_type' to common_template_data() so
    it can properly set the 'prefer_markup' bit.  Otherwise, it will
    guess without out svn:mime-type at its disposal.


git-svn-id: http://viewvc.tigris.org/svn/viewvc/trunk@2679 8cb11bc2-c004-0410-86c3-e597b4017df7
2011-11-29 15:17:59 +00:00
cmpilato 8cdccc1ea5 Fix a bug which prevented certain directory diff displays.
* lib/viewvc.py
  (diff_side_item): Pass the option to repos.itemlog() which says to
    include directory logs even for revisions in which the directory
    itself was not explicitly modified (props changed).

git-svn-id: http://viewvc.tigris.org/svn/viewvc/trunk@2659 8cb11bc2-c004-0410-86c3-e597b4017df7
2011-11-01 13:40:01 +00:00
cmpilato ccb53d164e *** THIS REVISION WAS REVERTED IN r2684 ***
Finish issue #495 ("Syntax highlight/colorize scripts without
extensions").

* lib/viewvc.py
  (markup_stream_pygments): Failing all else, use the Pygments
    guess_lexer() function to guess a file's content type from the
    first line of its text.  (Most of this patch is compensation for
    the first that if this heuristic codepath is traversed, we've eaten
    a line of text from the file object that we don't expect to have
    been eaten.

Patch by: Chris Mayo <cjmayo{__AT__}tigris.org>
          (Tweaked by me.)


git-svn-id: http://viewvc.tigris.org/svn/viewvc/trunk@2657 8cb11bc2-c004-0410-86c3-e597b4017df7
2011-10-31 21:39:33 +00:00
stilor 441da057cc * lib/viewvc.py
(DiffSource): Do not switch to flush state. Such switch causes changes
  to be displayed as removal and readdition.


git-svn-id: http://viewvc.tigris.org/svn/viewvc/trunk@2656 8cb11bc2-c004-0410-86c3-e597b4017df7
2011-10-28 20:37:01 +00:00
cmpilato a69597e29c Finish issue #470 ("No links to repository root logs").
* lib/viewvc.py
  (view_roots): Generate a log_href -- the revision log for the root
    directory of the repository -- where it makes sense to do so.

* templates/classic/roots.ezt,
* templates/default/roots.ezt
  Markup the last-modified-revision as a link to the log view where we can.

* docs/template-authoring-guide.html
  Note the additional data dictionary item.


git-svn-id: http://viewvc.tigris.org/svn/viewvc/trunk@2653 8cb11bc2-c004-0410-86c3-e597b4017df7
2011-10-28 19:24:37 +00:00
stilor 6e81b5eb1e * docs/template-authoring-guide.html
* templates/classic/include/diff_display.ezt
* lib/viewvc.py
  Rename 'display_as' to 'diff_block_format', as discussed on ML.


git-svn-id: http://viewvc.tigris.org/svn/viewvc/trunk@2650 8cb11bc2-c004-0410-86c3-e597b4017df7
2011-10-27 18:20:06 +00:00
cmpilato 2b5e7b51a0 On the 'property-diff' branch: rename the 'diff' template data
dictionary item to 'diffs' for consistency with other multi-value
items.  Yes, I know it makes the template usage itself weird
... "diffs.changes" instead of "diff.changes", but...

* lib/viewvc.py
  (view_diff): Store the desc.changes in the 'diffs' data dictionary
    item, not the 'diff' item.

* templates/diff.ezt
* templates/include/diff_display.ezt
  Replace uses of 'diff' with 'diffs'.  Selectively, of course.


git-svn-id: http://viewvc.tigris.org/svn/viewvc/branches/property-diff@2643 8cb11bc2-c004-0410-86c3-e597b4017df7
2011-10-26 19:11:41 +00:00
stilor 4bf50b31f7 * viewvc.py
Follow existing conventions on indenting function arguments/hash initializers
  carried over to the next line.


git-svn-id: http://viewvc.tigris.org/svn/viewvc/branches/property-diff@2628 8cb11bc2-c004-0410-86c3-e597b4017df7
2011-10-17 19:06:27 +00:00
stilor 68496ebc9f * diff_display.ezt
* viewvc.py
  Expand tabs to spaces, as per review.


git-svn-id: http://viewvc.tigris.org/svn/viewvc/branches/property-diff@2627 8cb11bc2-c004-0410-86c3-e597b4017df7
2011-10-17 18:51:52 +00:00
stilor a789c13698 * 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
2011-10-16 19:02:32 +00:00
stilor 44a6fe7465 * viewvc.py
(view_diff): Pass anchor locations to the diff template.

* diff_display.ezt
  (top-level): Generate anchors.

* revision.ezt
  (path links): Use anchors to point to content and property parts of the diff.


git-svn-id: http://viewvc.tigris.org/svn/viewvc/branches/property-diff@2625 8cb11bc2-c004-0410-86c3-e597b4017df7
2011-10-16 18:50:08 +00:00
stilor 90a1d6cae2 * viewvc.py
(DiffDescription): Add support for property diffs.
  (diff_side_item): Store properties hash in the side items.
  (view_diff): Generate property diffs.

* diff_display.ezt
  (headers): Indicate the property being diffed, if applicable.


git-svn-id: http://viewvc.tigris.org/svn/viewvc/branches/property-diff@2624 8cb11bc2-c004-0410-86c3-e597b4017df7
2011-10-16 08:12:51 +00:00
stilor 4fe882972a * viewvc.py:
(view_diff): Remove unused local variables.


git-svn-id: http://viewvc.tigris.org/svn/viewvc/branches/property-diff@2623 8cb11bc2-c004-0410-86c3-e597b4017df7
2011-10-16 07:58:18 +00:00
stilor f57be6e516 * viewvc.py
(DiffDescription): New class. Move the diff format selection and processing
  to this new class. Split the processing into "preparation" and actual diff.

The ideas behind this new class are:
1. It will accumulate the diff "blocks". Currently, it will handle content and
properties. In the future, it can be easily reused to accumulate diffs for
recursive ("revision") diff.
2. It separates the diff method from the selection of content to be diffed.
We have two content inputs (content, properties), four formats (raw, traditional
side-by-side, intraline side-by-side, intraline unified). The former two expect
a stream (fp), the latter two expect array of lines. This class makes each of
these chunks separate from each other.


git-svn-id: http://viewvc.tigris.org/svn/viewvc/branches/property-diff@2622 8cb11bc2-c004-0410-86c3-e597b4017df7
2011-10-16 07:29:23 +00:00
stilor c819b3a3fc * diff_display.ezt
(raw): Gracefully handle the case where there are no changes (output
  "No changes" instead of not displaying anything).

* viewvc.py
  (diff_parse_headers): Detect if there were no input from diff stream,
  report RCSDIFF_NO_CHANGES in this case.
  (view_diff): If binary/empty changes are detected, relay that information
  to the template.


git-svn-id: http://viewvc.tigris.org/svn/viewvc/branches/property-diff@2621 8cb11bc2-c004-0410-86c3-e597b4017df7
2011-10-16 07:06:51 +00:00
stilor 682ff6c9b9 * viewvc.py
(diff_side_item): Do not return log_entry, it is not used. Rename
  "bare" and "links" items to more descriptive "prop" and "content".


git-svn-id: http://viewvc.tigris.org/svn/viewvc/branches/property-diff@2620 8cb11bc2-c004-0410-86c3-e597b4017df7
2011-10-16 06:48:47 +00:00
stilor 988f5b535e * viewvc.py
(view_diff): In preparation for factoring out the "differ" code, make view_diff
  always pass the differences as 'changes' array/stream. The format is now selected
  via new 'display_as' argumnet.

* diff_display.ezt
  (all formats): Accommodate changes in viewvc.py



git-svn-id: http://viewvc.tigris.org/svn/viewvc/branches/property-diff@2619 8cb11bc2-c004-0410-86c3-e597b4017df7
2011-10-16 06:25:38 +00:00
stilor 7cdab259b8 * viewvc.py
(is_undisplayable): New function to check if property name/value
  can be displayed. Use this function in current file/dir/revision views.


git-svn-id: http://viewvc.tigris.org/svn/viewvc/branches/property-diff@2615 8cb11bc2-c004-0410-86c3-e597b4017df7
2011-10-16 05:33:25 +00:00
stilor 04329a707b * viewvc.py
(view_diff): Make diff an iterable (sequence); later property changes will be
  added to the sequence. Pass hide_legend, left_rev, right_rev outside of the
  diff[] array to untie diff.ezt from include/diff_display.ezt. Rename format
  to diff_format for consistency with template name.

* diff.ezt
  Same, plus small fixes in legend: capitalize first letter in 'changed',
  refer to revision as such, not as 'v.XXX' - such references are not used
  anywhere else.
  


git-svn-id: http://viewvc.tigris.org/svn/viewvc/branches/property-diff@2613 8cb11bc2-c004-0410-86c3-e597b4017df7
2011-10-06 05:37:56 +00:00
stilor 888f7ee302 * viewvc.py
(view_diff): Restore try-except block. It is unused for SVN,
  but still used for CVS.


git-svn-id: http://viewvc.tigris.org/svn/viewvc/branches/property-diff@2612 8cb11bc2-c004-0410-86c3-e597b4017df7
2011-10-06 05:07:49 +00:00
stilor 7466b03e7c * viewvc.py
(view_diff): Factor out common code preparing left/right item information into a new
  function, diff_side_item.
  (diff_side_item): New function.


git-svn-id: http://viewvc.tigris.org/svn/viewvc/branches/property-diff@2607 8cb11bc2-c004-0410-86c3-e597b4017df7
2011-10-01 19:25:00 +00:00
stilor 737b5d2b23 * viewvc.py
(view_diff): Remove try-except block, exceptions are now handled in
    setup_diff with more specific error messages. Merge the 'if fp'
    block with the preceding conditional - which is the only way fp
    is set to non-None.


git-svn-id: http://viewvc.tigris.org/svn/viewvc/branches/property-diff@2606 8cb11bc2-c004-0410-86c3-e597b4017df7
2011-10-01 07:10:10 +00:00
stilor c6775f5b89 * common.py
New file to house common definitions; _item and _RCSDIFF_*
  for now. Remove local definitions in the rest of modules.

* idiff.py
  (sidebyside, unified): Return _RCSDIFF_NO_CHANGES type if
  the generator failed to yield anything else.
  (sidebyside): Add type attribute to the returned tuple so
  that template can check the type.

* diff_display.ezt
  (top-level): Define messages to be used if diffs cannot be
  displayed. Use the definitions in all non-raw displays.
  (sidebyside,unified): Handle _RCSDIFF_IS_BINARY and
  _RCSDIFF_NO_CHANGES; the former is not returned yet - will
  be passed to the template once properties are diffed.


git-svn-id: http://viewvc.tigris.org/svn/viewvc/branches/property-diff@2605 8cb11bc2-c004-0410-86c3-e597b4017df7
2011-10-01 06:33:22 +00:00
stilor eba17bcbd7 * viewvc.py
(view_diff): Encapsulate into a single _item parts that would
  be repeated when multiple "diffable" items will be passed to diff.ezt.
  At that time, diff will be changed to a sequence.

* diff_display.ezt, diff.ezt
  Prefix those repeatable parts with 'diff'.


git-svn-id: http://viewvc.tigris.org/svn/viewvc/branches/property-diff@2604 8cb11bc2-c004-0410-86c3-e597b4017df7
2011-10-01 05:35:15 +00:00