(_rootpath2url): Try a different approach that should actually
handle spaces in the "in-repos" path, too, and maybe (if I'm super
lucky) also work on Windows.
git-svn-id: http://viewvc.tigris.org/svn/viewvc/trunk@2707 8cb11bc2-c004-0410-86c3-e597b4017df7
(): 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
reintroduces the issue #495 feature ("Syntax highlight/colorize
scripts without extensions") while building much more fault tolerance
into the system.
git-svn-id: http://viewvc.tigris.org/svn/viewvc/trunk@2699 8cb11bc2-c004-0410-86c3-e597b4017df7
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
### "annotate view without syntax coloration" codepath. ###
On the 'issue-495-dev' branch: Let vclib API consumers request that
annotation data come with or without the associated text.
* lib/vclib/__init__.py
(Repository.annotate): Add optional 'include_text' parameter.
* lib/vclib/svn/svn_ra.py
(RemoteSubversionRepository.annotate): Add 'include_text' parameter
and, if False, have the annotation callback drop the text on the floor.
* lib/vclib/svn/svn_repos.py
(BlameSource.__init__): Add 'include_text' param; squirrel away the value.
(BlameSource._blame_cb): Don't keep text we're asked not to keep.
(LocalSubversionRepository.annotate): Add 'include_text' parameter,
passed to BlameSource.__init__.
* lib/vclib/ccvs/bincvs.py
(BinCVSRepository.annotate): Add 'include_text' parameter, passed to
blame.BlameSource().
* lib/vclib/ccvs/ccvs.py
(CCVSRepository.annotate): Add 'include_text' parameter, passed to
blame.BlameSource().
* lib/vclib/ccvs/blame.py
(BlameSource.__init__): Add 'include_text' param; squirrel away the value.
(BlameSource.__getitem__): Don't keep text we're asked not to keep.
* lib/blame.py
(HTMLBlameSource.__init__): Update call to repos.annotate().
git-svn-id: http://viewvc.tigris.org/svn/viewvc/branches/issue-495-dev@2696 8cb11bc2-c004-0410-86c3-e597b4017df7
* 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
(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
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
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
(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
* templates/default/markup.ezt
Delete as unused.
* templates/default/include/fileview.ezt
Delete, after merging contents into...
* templates/default/file.ezt
...here. Also, port the [hide_binary_garbage] stuff from the classic
templates.
* templates/default/docroot/styles.css
(.vc_notice): New class.
git-svn-id: http://viewvc.tigris.org/svn/viewvc/trunk@2678 8cb11bc2-c004-0410-86c3-e597b4017df7
* templates/default/query_results.ezt
Display warning text when query results are superficially truncated.
* templates/default/docroot/styles.css
(.vc_warning): New style.
git-svn-id: http://viewvc.tigris.org/svn/viewvc/trunk@2676 8cb11bc2-c004-0410-86c3-e597b4017df7
contain non-URI-safe characters (spaces, non-ASCII stuff, etc.)
* lib/vclib/svn/svn_repos.py
(_rootpath2url): Use urllib.pathname2url to URL-encode the path
portion of the URL we are building.
git-svn-id: http://viewvc.tigris.org/svn/viewvc/trunk@2674 8cb11bc2-c004-0410-86c3-e597b4017df7
* bin/svndbadmin
(SvnRev.__init__): Update the logic used to calculate change types
and diff objects to no longer assume that deleted paths have None
for their change.path. (Subversion's 1.7 bindings always populate
change.path.)
git-svn-id: http://viewvc.tigris.org/svn/viewvc/trunk@2671 8cb11bc2-c004-0410-86c3-e597b4017df7
* templates/default/docroot/styles.css
Layout/style tweaks to the new default template set.
git-svn-id: http://viewvc.tigris.org/svn/viewvc/trunk@2660 8cb11bc2-c004-0410-86c3-e597b4017df7
* 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
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
(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
* 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
* templates/default/log.ezt,
* templates/default/docroot/styles.css,
More markup changes to the default templates.
git-svn-id: http://viewvc.tigris.org/svn/viewvc/trunk@2652 8cb11bc2-c004-0410-86c3-e597b4017df7
* templates/default/log.ezt,
* templates/default/graph.ezt,
* templates/default/diff.ezt,
* templates/default/include/diff_display.ezt
Take a stab at updating the new default templates to handle the
property diff stuff.
git-svn-id: http://viewvc.tigris.org/svn/viewvc/trunk@2651 8cb11bc2-c004-0410-86c3-e597b4017df7
* 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
* conf/viewvc.conf.dist
Use the "classic" templates until the "default" ones can be updated
to reflect recent improvements (such as the property-diff stuff).
git-svn-id: http://viewvc.tigris.org/svn/viewvc/trunk@2649 8cb11bc2-c004-0410-86c3-e597b4017df7
new default for ViewVC 1.2. We'll keep the old templates around as a
"classic" option.
* lib/config.py,
* conf/viewvc.conf.dist
(Config.set_defaults): Set cfg.options.template_dir to
"templates/default", and make the matching edit in the pristine
configuration file.
* templates/:
Now just a container for...
* templates/classic/,
* templates/classic/*:
...the old default templates (which were 'templates' and 'templates/*'.
* templates/default/,
templates/default/*:
...and the new default, copied from the 'templates-contrib/1.1' area.
git-svn-id: http://viewvc.tigris.org/svn/viewvc/trunk@2647 8cb11bc2-c004-0410-86c3-e597b4017df7
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
(top level) Introduce formatting rules for 4th and 5th levels of variables.
(diff.ezt) Update for the changes on the property-diff branch. Describe
missing parts (intraline diffs, patch_href). Fix some typos and copy-paste
errors.
git-svn-id: http://viewvc.tigris.org/svn/viewvc/branches/property-diff@2642 8cb11bc2-c004-0410-86c3-e597b4017df7
Try to document the creation of new release branches (though it's been a
while since I've done that, so this is all subject to my imperfect memory.)
git-svn-id: http://viewvc.tigris.org/svn/viewvc/trunk@2637 8cb11bc2-c004-0410-86c3-e597b4017df7