You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@subversion.apache.org by Karl Fogel <kf...@red-bean.com> on 2008/06/03 01:46:49 UTC

Re: [PATCH] Allow custom default when mapping (hook script mailer.py)

Olav Vitters <ol...@bkor.dhs.org> writes:
> I'd really appreciate thing being committed, or even just looked at. Out
> of the 5 patches I've mailed, only 1 patch seems to have gotten a
> response. Two haven't even arrived (although I was subscribed). Attached
> patch for instance did not get a response.

Sorry about that.  We moderate pretty carefully; I don't know why your
posts wouldn't get through...

> I'd really like to enhance mailer.py (fix TODOs), but please.. review
> these patches.

Did your original postings include log messages, as described in
http://subversion.tigris.org/hacking.html#patches ?  Having a log
message dramatically increases the chances of a patch being reviewed.

The version you included in this most recent post does not seem to have
a log message.  I tweaked the patch (so the code would not exceed the 80
column limit), and wrote a log message.  However, I am not sure the
change is correct: for one thing, the string "_default_" does not appeal
in the example conf file, although "[default]" does.  But I'm not very
familiar with mailer.py, so perhaps you can explain this.

In the meantime, below is a suggested log message and new patch, please
review.

-Karl

[[[
* tools/hook-scripts/mailer/mailer.py
  (Config._prep_maps): Have the mapping lambda look for the default
    value if nothing more specific is available.

Patch by: Olav Vitters <ol...@bkor.dhs.org>
(Formatting and comment wording tweaked by me.)
]]]

Index: tools/hook-scripts/mailer/mailer.py
===================================================================
--- tools/hook-scripts/mailer/mailer.py	(revision 31497)
+++ tools/hook-scripts/mailer/mailer.py	(working copy)
@@ -1219,12 +1219,13 @@
           raise UnknownMappingSection(sectname)
         # construct a lambda to look up the given value as an option name,
         # and return the option's value. if the option is not present,
-        # then just return the value unchanged.
+        # then return the _default_ option (or if that fails, return
+        # the value unchanged).
         setattr(self.maps, optname,
                 lambda value,
-                       sect=getattr(self, sectname): getattr(sect,
-                                                         From dev-return-107177-daniel=haxx.se@subversion.tigris.org  Tue Jun  3 03:47:54 2008
Return-Path: <de...@subversion.tigris.org>
Received: from giant.haxx.se (root@giant.haxx.se [83.168.254.42])
	by kluster1.contactor.se (8.13.8/8.13.8/Debian-3) with ESMTP id m531lWdR004987
	for <da...@contactor.se>; Tue, 3 Jun 2008 03:47:42 +0200
Received: from tigris.org (sc157.sjc.collab.net [204.16.104.146])
	by giant.haxx.se (8.14.2/8.14.2/Debian-3) with SMTP id m531lYhJ021134
	for <da...@haxx.se>; Tue, 3 Jun 2008 03:47:34 +0200
Received: (qmail 26866 invoked by uid 5000); 3 Jun 2008 01:47:26 -0000
Mailing-List: contact dev-help@subversion.tigris.org; run by ezmlm
Precedence: bulk
list-help: <ma...@subversion.tigris.org>
list-unsubscribe: <ma...@subversion.tigris.org>
list-post: <ma...@subversion.tigris.org>
Delivered-To: mailing list dev@subversion.tigris.org
Received: (qmail 26856 invoked from network); 3 Jun 2008 01:47:26 -0000
X-IronPort-Anti-Spam-Filtered: true
X-IronPort-Anti-Spam-Result: AokEAOs/REhCksE9VGdsb2JhbACReQEWBQYInQ0D
X-IronPort-AV: E=Sophos;i="4.27,580,1204531200"; 
   d="scan'208";a="6573021"
X-IRONPORT: SCANNED
From: Karl Fogel <kf...@red-bean.com>
To: dev@subversion.tigris.org
References: <48...@btopenworld.com>
	<48...@btopenworld.com>
Reply-To: Karl Fogel <kf...@red-bean.com>
Mail-followup-to: dev@subversion.tigris.org
Date: Mon, 02 Jun 2008 21:47:18 -0400
In-Reply-To: <48...@btopenworld.com> (Julian Foad's message of
	"Thu, 29 May 2008 17:11:20 +0100")
Message-ID: <87...@red-bean.com>
User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/23.0.60 (gnu/linux)
MIME-Version: 1.0
Content-Type: text/plain; charset=us-ascii
Subject: 
	 Re: [PATCH] Fix a depth bug in deprecated APIs svn_wc_resolved_conflict*()

Julian Foad <ju...@btopenworld.com> writes:
> Committed revision 31514.
>
> Being deprecated APIs, they're not covered by any of our tests, so at
> least one review would be appreciated.

FWIW, I reviewed the change (looked good to me, nice catch).

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

    value.lower(),
-                                                             value))
+                       sect=getattr(self, sectname):
+                            getattr(sect, value.lower(),
+                                    getattr(sect, '_default_', value)))
         # mark for removal when all optnames are done
         if sectname not in mapsections:
           mapsections.append(sectname)

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

Re: [PATCH] Allow custom default when mapping (hook script mailer.py)

Posted by Daniel Shahaf <d....@daniel.shahaf.co.il>.
Filed as issue #3225: 
http://subversion.tigris.org/issues/show_bug.cgi?id=3225

Olav, are you here?

Daniel Shahaf wrote on Sat, 14 Jun 2008 at 17:22 +0300:
> Karl Fogel wrote on Mon, 2 Jun 2008 at 21:50 -0400:
> > For this change to go in, the new "_default_" feature also needs to be
> > documented in the example config file.  A feature that no one knows
> > about, or that no one knows how to use, might as well not exist.
> > 
> > Thanks,
> > -Karl
> > 
> 
> Olav, have you seen Karl's email?  Are you intending to send a new version 
> of this patch with the changes Karl suggested (in the email I'm quoting 
> and elsethread)?
> 
> Daniel

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

Re: [PATCH] Allow custom default when mapping (hook script mailer.py)

Posted by Daniel Shahaf <d....@daniel.shahaf.co.il>.
Karl Fogel wrote on Mon, 2 Jun 2008 at 21:50 -0400:
> For this change to go in, the new "_default_" feature also needs to be
> documented in the example config file.  A feature that no one knows
> about, or that no one knows how to use, might as well not exist.
> 
> Thanks,
> -Karl
> 

Olav, have you seen Karl's email?  Are you intending to send a new version 
of this patch with the changes Karl suggested (in the email I'm quoting 
and elsethread)?

Daniel

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

Re: [PATCH] Allow custom default when mapping (hook script mailer.py)

Posted by Karl Fogel <kf...@red-bean.com>.
Karl Fogel <kf...@red-bean.com> writes:
> Olav Vitters <ol...@bkor.dhs.org> writes:
>> I'd really appreciate thing being committed, or even just looked at. Out
>> of the 5 patches I've mailed, only 1 patch seems to have gotten a
>> response. Two haven't even arrived (although I was subscribed). Attached
>> patch for instance did not get a response.
>
> Sorry about that.  We moderate pretty carefully; I don't know why your
> posts wouldn't get through...
>
>> I'd really like to enhance mailer.py (fix TODOs), but please.. review
>> these patches.
>
> Did your original postings include log messages, as described in
> http://subversion.tigris.org/hacking.html#patches ?  Having a log
> message dramatically increases the chances of a patch being reviewed.
>
> The version you included in this most recent post does not seem to have
> a log message.  I tweaked the patch (so the code would not exceed the 80
> column limit), and wrote a log message.  However, I am not sure the
> change is correct: for one thing, the string "_default_" does not appeal
> in the example conf file, although "[default]" does.  But I'm not very
> familiar with mailer.py, so perhaps you can explain this.

Ah, I just read

  http://thread.gmane.org/gmane.comp.version-control.subversion.devel/95393

...kindly referred to by Daniel Shahaf.  (This shows how important it is
to give context! :-) ).

For this change to go in, the new "_default_" feature also needs to be
documented in the example config file.  A feature that no one knows
about, or that no one knows how to use, might as well not exist.

Thanks,
-Karl

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