[trac-tracnav-plugin] - Add patch from upstream for Trac 0.12 compatibility.
Thomas Moschny
thm at fedoraproject.org
Thu Jan 6 23:45:44 UTC 2011
commit ee7dd641a37e95df9450a32960db97d67f4453d1
Author: Thomas Moschny <thm at fedoraproject.org>
Date: Fri Jan 7 00:44:35 2011 +0100
- Add patch from upstream for Trac 0.12 compatibility.
trac-tracnav-plugin.spec | 8 ++++-
tracnav-4.1-trac-0.12-compat.patch | 66 ++++++++++++++++++++++++++++++++++++
2 files changed, 73 insertions(+), 1 deletions(-)
---
diff --git a/trac-tracnav-plugin.spec b/trac-tracnav-plugin.spec
index 3432b33..5dad308 100644
--- a/trac-tracnav-plugin.spec
+++ b/trac-tracnav-plugin.spec
@@ -4,12 +4,13 @@
Name: trac-tracnav-plugin
Version: 4.1
-Release: 3%{?dist}
+Release: 4%{?dist}
Summary: Navigation Bar for Trac
Group: Applications/Internet
License: GPLv2+
URL: http://svn.ipd.uka.de/trac/javaparty/wiki/TracNav
Source: http://pypi.python.org/packages/source/T/TracNav/TracNav-%{version}.zip
+Patch0: tracnav-4.1-trac-0.12-compat.patch
BuildArch: noarch
BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-root-%(%{__id_u} -n)
BuildRequires: python-devel
@@ -28,6 +29,8 @@ that was originally supplied with Trac.
%prep
%setup -n %{tarname} -q
+# from r3276
+%patch0 -p0
%build
@@ -50,6 +53,9 @@ rm -rf %{buildroot}
%changelog
+* Fri Jan 7 2011 Thomas Moschny <thomas.moschny at gmx.de> - 4.1-4
+- Add patch from upstream for Trac 0.12 compatibility.
+
* Thu Jul 22 2010 David Malcolm <dmalcolm at redhat.com> - 4.1-3
- Rebuilt for https://fedoraproject.org/wiki/Features/Python_2.7/MassRebuild
diff --git a/tracnav-4.1-trac-0.12-compat.patch b/tracnav-4.1-trac-0.12-compat.patch
new file mode 100644
index 0000000..12fac0b
--- /dev/null
+++ b/tracnav-4.1-trac-0.12-compat.patch
@@ -0,0 +1,66 @@
+Index: README
+===================================================================
+--- README (revision 3275)
++++ README (revision 3276)
+@@ -66,7 +66,7 @@
+ -------------------
+
+ Copyright 2005-2006, Bernhard Haumacher (haui at haumacher.de)
+-Copyright 2005-2008, Thomas Moschny (thomas.moschny at gmx.de)
++Copyright 2005-2010, Thomas Moschny (thomas.moschny at gmx.de)
+
+ This program is free software; you can redistribute it and/or modify
+ it under the terms of the GNU General Public License as published by
+Index: tracnav/tracnav.py
+===================================================================
+--- tracnav/tracnav.py (revision 3275)
++++ tracnav/tracnav.py (revision 3276)
+@@ -34,7 +34,7 @@
+ == Author and License ==
+
+ * Copyright 2005-2006, Bernhard Haumacher (haui at haumacher.de)
+- * Copyright 2005-2008, Thomas Moschny (thomas.moschny at gmx.de)
++ * Copyright 2005-2010, Thomas Moschny (thomas.moschny at gmx.de)
+
+ {{{
+ This program is free software; you can redistribute it and/or modify
+@@ -63,6 +63,7 @@
+ from trac.wiki.model import WikiPage
+ from trac.wiki.formatter import Formatter, OneLinerFormatter
+ from trac.util.html import Markup
++from trac.util import arity
+ from genshi.builder import tag
+ from StringIO import StringIO
+
+@@ -87,6 +88,7 @@
+ OneLinerFormatter.__init__(self, env, ctx)
+ self.lastlink = None
+ self.allowed_macros = allowed_macros
++ self.mf_argcount = arity(OneLinerFormatter._macro_formatter)
+
+ def format_toc(self, wikitext):
+ self.lastlink = None
+@@ -100,14 +102,20 @@
+ return OneLinerFormatter._make_link(
+ self, namespace, target, *args)
+
+- def _macro_formatter(self, match, fullmatch):
++ def _macro_formatter(self, match, fullmatch, macro=None):
+ name = fullmatch.group('macroname')
+ if name in self.allowed_macros:
+ # leapfrog the OneLinerFormatter
+- return Formatter._macro_formatter(self, match, fullmatch)
++ if self.mf_argcount == 4:
++ return Formatter._macro_formatter(self, match, fullmatch, macro)
++ else:
++ return Formatter._macro_formatter(self, match, fullmatch)
+ else:
+ # use the OneLinerFormatter
+- return OneLinerFormatter._macro_formatter(self, match, fullmatch)
++ if self.mf_argcount == 4:
++ return OneLinerFormatter._macro_formatter(self, match, fullmatch, macro)
++ else:
++ return OneLinerFormatter._macro_formatter(self, match, fullmatch)
+
+ # FIXME: what about _make_relative_link() ?
+ # FIXME: CamelCase links are special and not handled by the Formatter...
More information about the scm-commits
mailing list