[Trac] Re: Patching Problems

2007-10-31 Thread Erik Bray

On 10/31/07, Andrew <[EMAIL PROTECTED]> wrote:
>
> I'm trying to apply patches to my Trac install. I'm running Trac on a
> Windows system and have installed the patch command, but I keep
> getting hunk failed error messages as below:
>
> patch --binary -p0 < trac-0.10.3-report-plugin.patch
> patching file trac/ticket/report.py
> Hunk #1 FAILED at 32.
> Hunk #2 FAILED at 131.
> Hunk #3 FAILED at 386.
> Hunk #4 FAILED at 412.
> 4 out of 4 hunks FAILED -- saving rejects to file trac/ticket/
> report.py.rej
>
> patch --binary -p0 < trac-no-notify-updater-2247.patch
> patching file trac/ticket/notification.py
> Hunk #1 FAILED at 247.
> 1 out of 1 hunk FAILED -- saving rejects to file trac/ticket/
> notification.py.rej
>
> If someone could point out what I'm going wrong that would be great.
>
> Also do the patches patch the live system or the install files?

Well, what version of Trac are you trying to patch?  The first one
says that it's for 0.10.3.  If you're not patching 0.10.3 then the
results cannot be guaranteed.  Same with the other one--whatever
documentation it came with should specify which version of Trac it's
diffed against.

As for which files you're patching, that entirely depends on what your
current working directory is when you run patch.

--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups "Trac 
Users" group.
To post to this group, send email to trac-users@googlegroups.com
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/trac-users?hl=en
-~--~~~~--~~--~--~---



[Trac] Re: Patching Problems

2007-11-01 Thread Andrew

Hi Erik,

Thanks for replying. I'm running Trac 0.10.3, so the report plugin
should work. The no notify patch is for 0.10.4, I was more hopeful
that the patch would apply.

Thanks again

On 31 Oct, 17:16, "Erik Bray" <[EMAIL PROTECTED]> wrote:
> On 10/31/07, Andrew <[EMAIL PROTECTED]> wrote:
>
>
>
>
>
>
>
> > I'm trying to apply patches to my Trac install. I'm running Trac on a
> > Windows system and have installed the patch command, but I keep
> > getting hunk failed error messages as below:
>
> > patch --binary -p0 < trac-0.10.3-report-plugin.patch
> > patching file trac/ticket/report.py
> > Hunk #1 FAILED at 32.
> > Hunk #2 FAILED at 131.
> > Hunk #3 FAILED at 386.
> > Hunk #4 FAILED at 412.
> > 4 out of 4 hunks FAILED -- saving rejects to file trac/ticket/
> > report.py.rej
>
> > patch --binary -p0 < trac-no-notify-updater-2247.patch
> > patching file trac/ticket/notification.py
> > Hunk #1 FAILED at 247.
> > 1 out of 1 hunk FAILED -- saving rejects to file trac/ticket/
> > notification.py.rej
>
> > If someone could point out what I'm going wrong that would be great.
>
> > Also do the patches patch the live system or the install files?
>
> Well, what version of Trac are you trying to patch?  The first one
> says that it's for 0.10.3.  If you're not patching 0.10.3 then the
> results cannot be guaranteed.  Same with the other one--whatever
> documentation it came with should specify which version of Trac it's
> diffed against.
>
> As for which files you're patching, that entirely depends on what your
> current working directory is when you run patch.- Hide quoted text -
>
> - Show quoted text -


--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups "Trac 
Users" group.
To post to this group, send email to trac-users@googlegroups.com
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/trac-users?hl=en
-~--~~~~--~~--~--~---



[Trac] Re: Patching Problems

2007-11-01 Thread Erik Bray

On 11/1/07, Andrew <[EMAIL PROTECTED]> wrote:
>
> Hi Erik,
>
> Thanks for replying. I'm running Trac 0.10.3, so the report plugin
> should work. The no notify patch is for 0.10.4, I was more hopeful
> that the patch would apply.
>

I tried out the report patch on a fresh checkout of 0.10.3 and had no
problems.  So either you're not using the final version of 0.10.3, or
it has other modifications already that conflict with the patch.  If
you check the rejects file you

Erik

--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups "Trac 
Users" group.
To post to this group, send email to trac-users@googlegroups.com
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/trac-users?hl=en
-~--~~~~--~~--~--~---



[Trac] Re: Patching Problems

2007-11-02 Thread Erik Bray

Hrm.  Could you post the rejects file that gets generated at
trac/ticket/report.py.rej ?  Also, where are you obtaining the source
code from?  Directly from t.e.o or some other source?  The commands
you ran look correct, so I'm not sure what you could be doing
wrong...maybe it's a Windows thing.

On 11/2/07, Andrew <[EMAIL PROTECTED]> wrote:
>
> Hi Erik,
>
> I installed Trac on a clean system and tried applying the report patch
> like you did, I still get the same error. I must be doing something
> wrong, I'm just not sure what...
>
> Thanks
>
> On 1 Nov, 16:06, "Erik Bray" <[EMAIL PROTECTED]> wrote:
> > On 11/1/07, Andrew <[EMAIL PROTECTED]> wrote:
> >
> >
> >
> > > Hi Erik,
> >
> > > Thanks for replying. I'm running Trac 0.10.3, so the report plugin
> > > should work. The no notify patch is for 0.10.4, I was more hopeful
> > > that the patch would apply.
> >
> > I tried out the report patch on a fresh checkout of 0.10.3 and had no
> > problems.  So either you're not using the final version of 0.10.3, or
> > it has other modifications already that conflict with the patch.  If
> > you check the rejects file you
> >
> > Erik

--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups "Trac 
Users" group.
To post to this group, send email to trac-users@googlegroups.com
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/trac-users?hl=en
-~--~~~~--~~--~--~---



[Trac] Re: Patching Problems

2007-11-02 Thread Andrew

Hi,

To install Trac I use method 3 on this page; 
http://trac.edgewall.org/wiki/TracOnWindows.
I don't install Subversion and I download the Trac installer
(trac-0.10.3.win32.exe) from http://ftp.edgewall.com/pub/trac/, the
link on the page points to version 0.10. I hope that answers your
question about where I get the source code from.

Here's the report.py.rej file:

***
*** 32,37 
  from trac.web.chrome import add_link, add_stylesheet,
INavigationContributor
  from trac.wiki import wiki_to_html, IWikiSyntaxProvider, Formatter

  class ReportModule(Component):

  implements(INavigationContributor, IPermissionRequestor,
IRequestHandler,
--- 32,57 
  from trac.web.chrome import add_link, add_stylesheet,
INavigationContributor
  from trac.wiki import wiki_to_html, IWikiSyntaxProvider, Formatter

+ class ITicketReportRenderer(Interface):
+ """Extension point interface for components that implement new
report
+ writing formats."""
+
+ def get_report_format():
+ """Called to get the id for a report format, for
example: .xls"""
+
+   def get_report_mimetype():
+   """Called to get the mimetype string for a report format"""
+
+   def get_report_linkname():
+   """Called to get the report link name that will appear on the
UI"""
+
+   def get_report_linkclass():
+   """Called to get the class of the link that will appear on the
UI"""
+
+   def render(req, cols, rows):
+   """Render the report, takes the request, columns and rows"""
+
+
  class ReportModule(Component):

  implements(INavigationContributor, IPermissionRequestor,
IRequestHandler,
***
*** 111,116 
  add_stylesheet(req, 'common/css/report.css')
  return 'report.cs', None

  # Internal methods

  def _do_create(self, req, db):
--- 131,138 
  add_stylesheet(req, 'common/css/report.css')
  return 'report.cs', None

+ renderers = ExtensionPoint(ITicketReportRenderer)
+
  # Internal methods

  def _do_create(self, req, db):
***
*** 364,370 
  elif format == 'tab':
  self._render_csv(req, cols, rows, '\t')
  return None
-
  return 'report.cs', None

  def add_alternate_links(self, req, args):
--- 386,397 
  elif format == 'tab':
  self._render_csv(req, cols, rows, '\t')
  return None
+ else:
+   for renderer in self.renderers:
+   if renderer.get_report_format()==format:
+   renderer.render(req,cols,rows)
+   return None
+
  return 'report.cs', None

  def add_alternate_links(self, req, args):
***
*** 385,390 
  if req.perm.has_permission('REPORT_SQL_VIEW'):
  add_link(req, 'alternate', '?format=sql', 'SQL Query',
   'text/plain')

  def execute_report(self, req, db, id, sql, args):
  sql, args = self.sql_sub_vars(req, sql, args, db)
--- 412,430 
  if req.perm.has_permission('REPORT_SQL_VIEW'):
  add_link(req, 'alternate', '?format=sql', 'SQL Query',
   'text/plain')
+
+ # add link for every loaded component
+ # that implements ITicketReportRenderer
+
+ for renderer in self.renderers:
+   format = renderer.get_report_format()
+   mimetype = renderer.get_report_mimetype()
+   linkname = renderer.get_report_linkname()
+   linkclass = renderer.get_report_linkclass()
+
+   add_link(req,'alternate','?format='+format+href,
+linkname,mimetype,linkclass)
+

  def execute_report(self, req, db, id, sql, args):
  sql, args = self.sql_sub_vars(req, sql, args, db)


I've installed Cygwin to see if I would be able to apply the patches
using that, but I get the same error message.

On 2 Nov, 13:47, "Erik Bray" <[EMAIL PROTECTED]> wrote:
> Hrm.  Could you post the rejects file that gets generated at
> trac/ticket/report.py.rej ?  Also, where are you obtaining the source
> code from?  Directly from t.e.o or some other source?  The commands
> you ran look correct, so I'm not sure what you could be doing
> wrong...maybe it's a Windows thing.
>
> On 11/2/07, Andrew <[EMAIL PROTECTED]> wrote:
>
>
>
>
>
> > Hi Erik,
>
> > I installed Trac on a clean system and tried applying the report patch
> > like you did, I still get the same error. I must be doing something
> > wrong, I'm just not sure what...
>
> > Thanks
>
> > On 1 Nov, 16:06, "Erik Bray" <[EMAIL PROTECTED]> wrote:
> > > On 11/1/07, Andrew <[EMAIL PROTECTED]> wrote:
>
> > > > Hi Erik,
>
> > > > Thanks for replying. I'm running Trac 0.10.3, so the report plugin
> > > > should work. The no notify patch is for 0.10.4, I was more hopeful
> > > > that the patch would apply.
>
> 

[Trac] Re: Patching Problems

2007-11-02 Thread Erik Bray

Aha! Of course.  Your patch program just isn't converting the newlines
from LF to CRLF and thus is getting confused.  Use a program like
unix2dos to convert the patch files.  Or if you have perl installed
you can perl -pi -e 's/\n/\r\n/g' trac-0.10.3-report-plugin.patch

On 11/2/07, Andrew <[EMAIL PROTECTED]> wrote:
>
> Hi,
>
> To install Trac I use method 3 on this page; 
> http://trac.edgewall.org/wiki/TracOnWindows.
> I don't install Subversion and I download the Trac installer
> (trac-0.10.3.win32.exe) from http://ftp.edgewall.com/pub/trac/, the
> link on the page points to version 0.10. I hope that answers your
> question about where I get the source code from.
>
> Here's the report.py.rej file:
>
> ***
> *** 32,37 
>   from trac.web.chrome import add_link, add_stylesheet,
> INavigationContributor
>   from trac.wiki import wiki_to_html, IWikiSyntaxProvider, Formatter
>
>   class ReportModule(Component):
>
>   implements(INavigationContributor, IPermissionRequestor,
> IRequestHandler,
> --- 32,57 
>   from trac.web.chrome import add_link, add_stylesheet,
> INavigationContributor
>   from trac.wiki import wiki_to_html, IWikiSyntaxProvider, Formatter
>
> + class ITicketReportRenderer(Interface):
> + """Extension point interface for components that implement new
> report
> + writing formats."""
> +
> + def get_report_format():
> + """Called to get the id for a report format, for
> example: .xls"""
> +
> +   def get_report_mimetype():
> +   """Called to get the mimetype string for a report format"""
> +
> +   def get_report_linkname():
> +   """Called to get the report link name that will appear on the
> UI"""
> +
> +   def get_report_linkclass():
> +   """Called to get the class of the link that will appear on the
> UI"""
> +
> +   def render(req, cols, rows):
> +   """Render the report, takes the request, columns and rows"""
> +
> +
>   class ReportModule(Component):
>
>   implements(INavigationContributor, IPermissionRequestor,
> IRequestHandler,
> ***
> *** 111,116 
>   add_stylesheet(req, 'common/css/report.css')
>   return 'report.cs', None
>
>   # Internal methods
>
>   def _do_create(self, req, db):
> --- 131,138 
>   add_stylesheet(req, 'common/css/report.css')
>   return 'report.cs', None
>
> + renderers = ExtensionPoint(ITicketReportRenderer)
> +
>   # Internal methods
>
>   def _do_create(self, req, db):
> ***
> *** 364,370 
>   elif format == 'tab':
>   self._render_csv(req, cols, rows, '\t')
>   return None
> -
>   return 'report.cs', None
>
>   def add_alternate_links(self, req, args):
> --- 386,397 
>   elif format == 'tab':
>   self._render_csv(req, cols, rows, '\t')
>   return None
> + else:
> +   for renderer in self.renderers:
> +   if renderer.get_report_format()==format:
> +   renderer.render(req,cols,rows)
> +   return None
> +
>   return 'report.cs', None
>
>   def add_alternate_links(self, req, args):
> ***
> *** 385,390 
>   if req.perm.has_permission('REPORT_SQL_VIEW'):
>   add_link(req, 'alternate', '?format=sql', 'SQL Query',
>'text/plain')
>
>   def execute_report(self, req, db, id, sql, args):
>   sql, args = self.sql_sub_vars(req, sql, args, db)
> --- 412,430 
>   if req.perm.has_permission('REPORT_SQL_VIEW'):
>   add_link(req, 'alternate', '?format=sql', 'SQL Query',
>'text/plain')
> +
> + # add link for every loaded component
> + # that implements ITicketReportRenderer
> +
> + for renderer in self.renderers:
> +   format = renderer.get_report_format()
> +   mimetype = renderer.get_report_mimetype()
> +   linkname = renderer.get_report_linkname()
> +   linkclass = renderer.get_report_linkclass()
> +
> +   add_link(req,'alternate','?format='+format+href,
> +linkname,mimetype,linkclass)
> +
>
>   def execute_report(self, req, db, id, sql, args):
>   sql, args = self.sql_sub_vars(req, sql, args, db)
>
>
> I've installed Cygwin to see if I would be able to apply the patches
> using that, but I get the same error message.
>
> On 2 Nov, 13:47, "Erik Bray" <[EMAIL PROTECTED]> wrote:
> > Hrm.  Could you post the rejects file that gets generated at
> > trac/ticket/report.py.rej ?  Also, where are you obtaining the source
> > code from?  Directly from t.e.o or some other source?  The commands
> > you ran look correct, so I'm not sure what you could be doing
> > wrong...maybe it's a Windows thing.
> >
> > On 11/2/07, Andrew <[EM

[Trac] Re: Patching Problems

2007-11-02 Thread Andrew

Hi Erik,

I installed Trac on a clean system and tried applying the report patch
like you did, I still get the same error. I must be doing something
wrong, I'm just not sure what...

Thanks

On 1 Nov, 16:06, "Erik Bray" <[EMAIL PROTECTED]> wrote:
> On 11/1/07, Andrew <[EMAIL PROTECTED]> wrote:
>
>
>
> > Hi Erik,
>
> > Thanks for replying. I'm running Trac 0.10.3, so the report plugin
> > should work. The no notify patch is for 0.10.4, I was more hopeful
> > that the patch would apply.
>
> I tried out the report patch on a fresh checkout of 0.10.3 and had no
> problems.  So either you're not using the final version of 0.10.3, or
> it has other modifications already that conflict with the patch.  If
> you check the rejects file you
>
> Erik


--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups "Trac 
Users" group.
To post to this group, send email to trac-users@googlegroups.com
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/trac-users?hl=en
-~--~~~~--~~--~--~---



[Trac] Re: Patching Problems

2007-11-06 Thread Andrew

Erik you're a star! I've got both patches applied. Thanks for the
help.

On 2 Nov, 17:05, "Erik Bray" <[EMAIL PROTECTED]> wrote:
> Aha! Of course.  Your patch program just isn't converting the newlines
> from LF to CRLF and thus is getting confused.  Use a program like
> unix2dos to convert the patch files.  Or if you have perl installed
> you can perl -pi -e 's/\n/\r\n/g' trac-0.10.3-report-plugin.patch
>
> On 11/2/07, Andrew <[EMAIL PROTECTED]> wrote:
>
>
>
>
>
> > Hi,
>
> > To install Trac I use method 3 on this 
> > page;http://trac.edgewall.org/wiki/TracOnWindows.
> > I don't install Subversion and I download the Trac installer
> > (trac-0.10.3.win32.exe) fromhttp://ftp.edgewall.com/pub/trac/, the
> > link on the page points to version 0.10. I hope that answers your
> > question about where I get the source code from.
>
> > Here's the report.py.rej file:
>
> > ***
> > *** 32,37 
> >   from trac.web.chrome import add_link, add_stylesheet,
> > INavigationContributor
> >   from trac.wiki import wiki_to_html, IWikiSyntaxProvider, Formatter
>
> >   class ReportModule(Component):
>
> >   implements(INavigationContributor, IPermissionRequestor,
> > IRequestHandler,
> > --- 32,57 
> >   from trac.web.chrome import add_link, add_stylesheet,
> > INavigationContributor
> >   from trac.wiki import wiki_to_html, IWikiSyntaxProvider, Formatter
>
> > + class ITicketReportRenderer(Interface):
> > + """Extension point interface for components that implement new
> > report
> > + writing formats."""
> > +
> > + def get_report_format():
> > + """Called to get the id for a report format, for
> > example: .xls"""
> > +
> > +   def get_report_mimetype():
> > +   """Called to get the mimetype string for a report format"""
> > +
> > +   def get_report_linkname():
> > +   """Called to get the report link name that will appear on 
> > the
> > UI"""
> > +
> > +   def get_report_linkclass():
> > +   """Called to get the class of the link that will appear on 
> > the
> > UI"""
> > +
> > +   def render(req, cols, rows):
> > +   """Render the report, takes the request, columns and rows"""
> > +
> > +
> >   class ReportModule(Component):
>
> >   implements(INavigationContributor, IPermissionRequestor,
> > IRequestHandler,
> > ***
> > *** 111,116 
> >   add_stylesheet(req, 'common/css/report.css')
> >   return 'report.cs', None
>
> >   # Internal methods
>
> >   def _do_create(self, req, db):
> > --- 131,138 
> >   add_stylesheet(req, 'common/css/report.css')
> >   return 'report.cs', None
>
> > + renderers = ExtensionPoint(ITicketReportRenderer)
> > +
> >   # Internal methods
>
> >   def _do_create(self, req, db):
> > ***
> > *** 364,370 
> >   elif format == 'tab':
> >   self._render_csv(req, cols, rows, '\t')
> >   return None
> > -
> >   return 'report.cs', None
>
> >   def add_alternate_links(self, req, args):
> > --- 386,397 
> >   elif format == 'tab':
> >   self._render_csv(req, cols, rows, '\t')
> >   return None
> > + else:
> > +   for renderer in self.renderers:
> > +   if renderer.get_report_format()==format:
> > +   renderer.render(req,cols,rows)
> > +   return None
> > +
> >   return 'report.cs', None
>
> >   def add_alternate_links(self, req, args):
> > ***
> > *** 385,390 
> >   if req.perm.has_permission('REPORT_SQL_VIEW'):
> >   add_link(req, 'alternate', '?format=sql', 'SQL Query',
> >'text/plain')
>
> >   def execute_report(self, req, db, id, sql, args):
> >   sql, args = self.sql_sub_vars(req, sql, args, db)
> > --- 412,430 
> >   if req.perm.has_permission('REPORT_SQL_VIEW'):
> >   add_link(req, 'alternate', '?format=sql', 'SQL Query',
> >'text/plain')
> > +
> > + # add link for every loaded component
> > + # that implements ITicketReportRenderer
> > +
> > + for renderer in self.renderers:
> > +   format = renderer.get_report_format()
> > +   mimetype = renderer.get_report_mimetype()
> > +   linkname = renderer.get_report_linkname()
> > +   linkclass = renderer.get_report_linkclass()
> > +
> > +   add_link(req,'alternate','?format='+format+href,
> > +linkname,mimetype,linkclass)
> > +
>
> >   def execute_report(self, req, db, id, sql, args):
> >   sql, args = self.sql_sub_vars(req, sql, args, db)
>
> > I've installed Cygwin to see if I would be able to apply the patches
> > using that, but I get the same error message.
>
> > On 2 Nov, 13:47, "Erik Bray" <[E

[Trac] Re: Patching Problems

2007-11-07 Thread Erik Bray

Great! Sorry I didn't notice that sooner, considering that all the
hunks were failing.  I hadn't paid attention to the fact that you were
on Windows, heh.

Erik

On 11/6/07, Andrew <[EMAIL PROTECTED]> wrote:
>
> Erik you're a star! I've got both patches applied. Thanks for the
> help.
>
> On 2 Nov, 17:05, "Erik Bray" <[EMAIL PROTECTED]> wrote:
> > Aha! Of course.  Your patch program just isn't converting the newlines
> > from LF to CRLF and thus is getting confused.  Use a program like
> > unix2dos to convert the patch files.  Or if you have perl installed
> > you can perl -pi -e 's/\n/\r\n/g' trac-0.10.3-report-plugin.patch
> >

--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups "Trac 
Users" group.
To post to this group, send email to trac-users@googlegroups.com
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/trac-users?hl=en
-~--~~~~--~~--~--~---