You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@subversion.apache.org by Robert Spier <rs...@pobox.com> on 2006/03/18 18:53:03 UTC

[PATCH] fix mailer.py show_nonmatching_paths blowup

Rationale: with show_nonmatching_paths set to yes, and a
configuration to send commit messages to multiple places, a
AttributeError: DiffGenerator instance has no attribute 'diff' would
be triggered in _render_diffs because it would never be added to the
instance.  This sets a default value of None.  (This is cleaner than
adding lots of has_attr checks to _render_diffs.)  I also discovered
that I really wanted show_nonmatching_paths=summary. ;)

-R

   * tools/look-scripts/mailer/mailer.py: ensure diff and diff_url
     properties exist on the DiffGenerator instances.
    
--- subversion/tools/hook-scripts/mailer/mailer.py   2006-02-19 20:42:20.000000000 -0800
+++ mailer.py   2006-03-18 10:43:37.000000000 -0800
@@ -665,6 +665,8 @@
     self.diffurls = diffurls
     self.pool = pool
 
+    self.diff = self.diff_url = None
+
     self.idx = 0
 
   def __nonzero__(self):

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@subversion.tigris.org
For additional commands, e-mail: dev-help@subversion.tigris.org

Re: [PATCH] fix mailer.py show_nonmatching_paths blowup

Posted by Robert Spier <rs...@pobox.com>.
Of course:

Traceback (most recent call last):
  File "/home/svn/bin/mailer.py", line 1283, in ?
    sys.argv[3:3+expected_args])
  File "/pkg/packages/svn-1.3.x/lib/svn-python/svn/core.py", line 217, in run_app
    return apply(func, (_core.application_pool,) + args, kw)
  File "/home/svn/bin/mailer.py", line 77, in main
    messenger.generate()
  File "/home/svn/bin/mailer.py", line 366, in generate
    group, params, paths, subpool)
  File "/home/svn/bin/mailer.py", line 623, in generate_content
    renderer.render(data)
  File "/home/svn/bin/mailer.py", line 908, in render
    self._render_diffs(data.other_diffs)
  File "/home/svn/bin/mailer.py", line 943, in _render_diffs
    if not diff.diff and not diff.diff_url:
AttributeError: DiffGenerator instance has no attribute 'diff'


At Mon, 20 Mar 2006 18:02:10 -0800,
Daniel Rall wrote:
> 
> Rob, will you provide a stack trace to go with this bug report?
> 
> Thanks!
> 
> On Sat, 18 Mar 2006, Robert Spier wrote:
> 
> > 
> > Rationale: with show_nonmatching_paths set to yes, and a
> > configuration to send commit messages to multiple places, a
> > AttributeError: DiffGenerator instance has no attribute 'diff' would
> > be triggered in _render_diffs because it would never be added to the
> > instance.  This sets a default value of None.  (This is cleaner than
> > adding lots of has_attr checks to _render_diffs.)  I also discovered
> > that I really wanted show_nonmatching_paths=summary. ;)
> > 
> > -R
> > 
> >    * tools/look-scripts/mailer/mailer.py: ensure diff and diff_url
> >      properties exist on the DiffGenerator instances.
> >     
> > --- subversion/tools/hook-scripts/mailer/mailer.py   2006-02-19 20:42:20.000000000 -0800
> > +++ mailer.py   2006-03-18 10:43:37.000000000 -0800
> > @@ -665,6 +665,8 @@
> >      self.diffurls = diffurls
> >      self.pool = pool
> >  
> > +    self.diff = self.diff_url = None
> > +
> >      self.idx = 0
> >  
> >    def __nonzero__(self):
> > 

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@subversion.tigris.org
For additional commands, e-mail: dev-help@subversion.tigris.org

Re: [PATCH] fix mailer.py show_nonmatching_paths blowup

Posted by Daniel Rall <dl...@collab.net>.
Rob, will you provide a stack trace to go with this bug report?

Thanks!

On Sat, 18 Mar 2006, Robert Spier wrote:

> 
> Rationale: with show_nonmatching_paths set to yes, and a
> configuration to send commit messages to multiple places, a
> AttributeError: DiffGenerator instance has no attribute 'diff' would
> be triggered in _render_diffs because it would never be added to the
> instance.  This sets a default value of None.  (This is cleaner than
> adding lots of has_attr checks to _render_diffs.)  I also discovered
> that I really wanted show_nonmatching_paths=summary. ;)
> 
> -R
> 
>    * tools/look-scripts/mailer/mailer.py: ensure diff and diff_url
>      properties exist on the DiffGenerator instances.
>     
> --- subversion/tools/hook-scripts/mailer/mailer.py   2006-02-19 20:42:20.000000000 -0800
> +++ mailer.py   2006-03-18 10:43:37.000000000 -0800
> @@ -665,6 +665,8 @@
>      self.diffurls = diffurls
>      self.pool = pool
>  
> +    self.diff = self.diff_url = None
> +
>      self.idx = 0
>  
>    def __nonzero__(self):
> 

Re: [PATCH] fix mailer.py show_nonmatching_paths blowup

Posted by Garrett Rooney <ro...@electricjellyfish.net>.
On 4/10/06, Michael W Thelen <mi...@pietdepsi.com> wrote:
> Robert Spier wrote:
> > Rationale: with show_nonmatching_paths set to yes, and a
> > configuration to send commit messages to multiple places, a
> > AttributeError: DiffGenerator instance has no attribute 'diff' would
> > be triggered in _render_diffs because it would never be added to the
> > instance.  This sets a default value of None.  (This is cleaner than
> > adding lots of has_attr checks to _render_diffs.)  I also discovered
> > that I really wanted show_nonmatching_paths=summary. ;)
> >
> > -R
> >
> >    * tools/look-scripts/mailer/mailer.py: ensure diff and diff_url
> >      properties exist on the DiffGenerator instances.
> >
> > --- subversion/tools/hook-scripts/mailer/mailer.py   2006-02-19 20:42:20.000000000 -0800
> > +++ mailer.py   2006-03-18 10:43:37.000000000 -0800
> > @@ -665,6 +665,8 @@
> >      self.diffurls = diffurls
> >      self.pool = pool
> >
> > +    self.diff = self.diff_url = None
> > +
> >      self.idx = 0
> >
> >    def __nonzero__(self):
>
> Ping... just making sure this patch hasn't been forgotten.  If no one
> does anything with it in the next few days, I'll go ahead and file an
> issue for it.

Committed in r19398.  Sorry for the delay Robert, and thanks for the
prodding Michael.

-garrett

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@subversion.tigris.org
For additional commands, e-mail: dev-help@subversion.tigris.org


Re: [PATCH] fix mailer.py show_nonmatching_paths blowup

Posted by Michael W Thelen <mi...@pietdepsi.com>.
Robert Spier wrote:
> Rationale: with show_nonmatching_paths set to yes, and a
> configuration to send commit messages to multiple places, a
> AttributeError: DiffGenerator instance has no attribute 'diff' would
> be triggered in _render_diffs because it would never be added to the
> instance.  This sets a default value of None.  (This is cleaner than
> adding lots of has_attr checks to _render_diffs.)  I also discovered
> that I really wanted show_nonmatching_paths=summary. ;)
> 
> -R
> 
>    * tools/look-scripts/mailer/mailer.py: ensure diff and diff_url
>      properties exist on the DiffGenerator instances.
>     
> --- subversion/tools/hook-scripts/mailer/mailer.py   2006-02-19 20:42:20.000000000 -0800
> +++ mailer.py   2006-03-18 10:43:37.000000000 -0800
> @@ -665,6 +665,8 @@
>      self.diffurls = diffurls
>      self.pool = pool
>  
> +    self.diff = self.diff_url = None
> +
>      self.idx = 0
>  
>    def __nonzero__(self):

Ping... just making sure this patch hasn't been forgotten.  If no one
does anything with it in the next few days, I'll go ahead and file an
issue for it.

-- 
Michael W Thelen
It is a mistake to think you can solve any major problems just with
potatoes.       -- Douglas Adams

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@subversion.tigris.org
For additional commands, e-mail: dev-help@subversion.tigris.org