Edgewall Software

Opened 8 years ago

Last modified 8 years ago

#12274 closed defect

Trap exceptions in Subversion backend when revision number is negative — at Version 1

Reported by: Ryan J Ollos Owned by: Ryan J Ollos
Priority: normal Milestone: 1.0.10
Component: version control Version:
Severity: normal Keywords: svn
Cc: Branch:
Release Notes:

SubversionException from invalid revision number is trapped and a TracError is raised.

API Changes:
Internal Changes:

Description

Invalid revisions such as a are trapped in the Subversion backend and a NoSuchChangeset exception is raised. However a negative revision number is not trapped and the SubversionException propagates. We should trap the exception and raise a NoSuchChangeset exception.

20:47:11 Trac[formatter] ERROR: Macro Include(source:proj1/workflow@-1) failed:
Traceback (most recent call last):
  File "/Users/rjollos/Documents/Workspace/th-dev/IncludeMacro/pve/lib/python2.7/site-packages/trac/wiki/formatter.py", line 789, in _macro_formatter
    return macro.ensure_inline(macro.process(args))
  File "/Users/rjollos/Documents/Workspace/th-dev/IncludeMacro/pve/lib/python2.7/site-packages/trac/wiki/formatter.py", line 358, in process
    text = self.processor(text)
  File "/Users/rjollos/Documents/Workspace/th-dev/IncludeMacro/pve/lib/python2.7/site-packages/trac/wiki/formatter.py", line 345, in _macro_processor
    text)
  File "/Users/rjollos/Documents/Workspace/th-dev/IncludeMacro/trunk/includemacro/macros.py", line 130, in expand_macro
    dest_format)
  File "/Users/rjollos/Documents/Workspace/th-dev/IncludeMacro/trunk/includemacro/macros.py", line 202, in _get_source
    node = repos.get_node(path, rev)
  File "/Users/rjollos/Documents/Workspace/th-dev/IncludeMacro/pve/lib/python2.7/site-packages/trac/versioncontrol/cache.py", line 298, in get_node
    return self.repos.get_node(path, self.normalize_rev(rev))
  File "/Users/rjollos/Documents/Workspace/th-dev/IncludeMacro/pve/lib/python2.7/site-packages/tracopt/versioncontrol/svn/svn_fs.py", line 511, in get_node
    return SubversionNode(path, rev, self, self.pool)
  File "/Users/rjollos/Documents/Workspace/th-dev/IncludeMacro/pve/lib/python2.7/site-packages/tracopt/versioncontrol/svn/svn_fs.py", line 768, in __init__
    self.root = fs.revision_root(self.fs_ptr, rev, pool)
  File "/Users/rjollos/Documents/Workspace/th-dev/IncludeMacro/pve/lib/python2.7/site-packages/libsvn/fs.py", line 319, in svn_fs_revision_root
    return _fs.svn_fs_revision_root(*args)
SubversionException: 160006 - Invalid revision number '-1'

Change History (1)

comment:1 by Ryan J Ollos, 8 years ago

Release Notes: modified (diff)

Fixed on 1.0-stable in [14454] , merged to trunk in [14455].

Note: See TracTickets for help on using tickets.