[Buildbot-commits] [Buildbot] #2165: Support ternary substitution in WithProperties

Buildbot nobody at buildbot.net
Sun Dec 18 22:38:31 UTC 2011


#2165: Support ternary substitution in WithProperties
------------------------+-----------------------
Reporter:  jaredgrubb   |      Owner:
    Type:  enhancement  |     Status:  new
Priority:  minor        |  Milestone:  undecided
 Version:  0.8.5        |   Keywords:
------------------------+-----------------------
 I think it would be nice to have support for "if (prop) then substitute X
 else substitute Y".

 Python supports back-references in a regex, so I'm imagining that a
 possible syntax would be:

 `:?` + `delimiter` + `true_substitution` + `delimiter` +
 `false_substitution`

 For example:

 * `%(prop:?:sub_true:sub_false)s`
 * `%(prop:?|sub_true|sub_false)s`
 * `%(prop:?Asub_trueAsub_false)s`

 I'm not sure if ":?" would check the property based on existence (i.e. as
 ":+" does) or on true-ness (i.e. as ":~" does), or whether it would be
 nice to support both options?

-- 
Ticket URL: <http://trac.buildbot.net/ticket/2165>
Buildbot <http://buildbot.net/>
Buildbot: build/test automation


More information about the Commits mailing list