Edgewall Software

Opened 11 years ago

Closed 11 years ago

Last modified 11 years ago

#11308 closed defect (fixed)

ValueError while rendering `log:@1-2-3` — at Version 2

Reported by: Jun Omae Owned by: Jun Omae
Priority: normal Milestone: 0.12.6
Component: version control/log view Version: 0.12-stable
Severity: normal Keywords: wiki
Cc: Branch:
Release Notes:

Fix ValueError while wiki-rendering log: link with invalid ranges, e.g. log:@1-2-3.

API Changes:
Internal Changes:

Description

When rendering log:@1-2-3 if each revision on the default repository is existent, I got the following error.

...
  File "/home/jun66j5/src/trac/edgewall/git/trac/ticket/templates/ticket_box.html", line 77, in <Expression u'wiki_to_html(context, ticket.description, escape_newlines=preserve_newlines)'>
    ${wiki_to_html(context, ticket.description, escape_newlines=preserve_newlines)}
  File "/home/jun66j5/src/trac/edgewall/git/trac/util/compat.py", line 83, in newfunc
    return func_(*(args + fargs), **dict(kwargs, **fkwargs))
  File "/home/jun66j5/src/trac/edgewall/git/trac/wiki/formatter.py", line 1501, in format_to_html
    return HtmlFormatter(env, context, wikidom).generate(escape_newlines)
  File "/home/jun66j5/src/trac/edgewall/git/trac/wiki/formatter.py", line 1456, in generate
    escape_newlines)
  File "/home/jun66j5/src/trac/edgewall/git/trac/wiki/formatter.py", line 1243, in format
    result = re.sub(self.wikiparser.rules, self.replace, line)
  File "/home/jun66j5/venv/py24/lib/python2.4/sre.py", line 142, in sub
    return _compile(pattern, 0).sub(repl, string, count)
  File "/home/jun66j5/src/trac/edgewall/git/trac/wiki/formatter.py", line 1161, in replace
    replacement = self.handle_match(fullmatch)
  File "/home/jun66j5/src/trac/edgewall/git/trac/wiki/formatter.py", line 1157, in handle_match
    return internal_handler(match, fullmatch)
  File "/home/jun66j5/src/trac/edgewall/git/trac/wiki/formatter.py", line 533, in _shref_formatter
    return self._make_link(ns, target, match, match, fullmatch)
  File "/home/jun66j5/src/trac/edgewall/git/trac/wiki/formatter.py", line 590, in _make_link
    fullmatch)
  File "/home/jun66j5/src/trac/edgewall/git/trac/versioncontrol/web_ui/log.py", line 373, in _format_link
    revranges = self._normalize_ranges(repos, path, revs)
  File "/home/jun66j5/src/trac/edgewall/git/trac/versioncontrol/web_ui/log.py", line 416, in _normalize_ranges
    return Ranges(ranges)
  File "/home/jun66j5/src/trac/edgewall/git/trac/util/__init__.py", line 724, in __init__
    self.appendrange(r)
  File "/home/jun66j5/src/trac/edgewall/git/trac/util/__init__.py", line 742, in appendrange
    a, b = int(x), int(x)
ValueError: invalid literal for int(): 1-2-3

Change History (2)

comment:1 by Jun Omae, 11 years ago

Owner: set to Jun Omae
Status: newassigned

My proposal fix is jomae.git:ticket11308.

comment:2 by Jun Omae, 11 years ago

Keywords: wiki added
Release Notes: modified (diff)
Resolution: fixed
Status: assignedclosed
Last edited 11 years ago by Ryan J Ollos (previous) (diff)
Note: See TracTickets for help on using tickets.