[svn.haxx.se] · SVN Dev · SVN Users · SVN Org · TSVN Dev · TSVN Users · Subclipse Dev · Subclipse Users · this month's index

Re: svn commit: r18649 - trunk/contrib/client-side

From: David James <djames_at_collab.net>
Date: 2006-03-01 01:43:55 CET

On 2/28/06, Giovanni Bajo <rasky@develer.com> wrote:
> djames@tigris.org wrote:
>
> > --- trunk/contrib/client-side/svnmerge.py (original) +++
> > trunk/contrib/client-side/svnmerge.py Tue Feb 28 13:25:28 2006 @@
> > -631,7 +631,7 @@ # the --verbose flag, the --quiet flag prevents
> > the commit log # message from being printed.
> > log_opts = '--quiet -r%s:%s "%s"' % (begin, end, url)
> > - if opts["bidirectional"]:
> > + if opts.has_key("bidirectional") and opts["bidirectional"]:
> > log_opts = "--verbose " + log_opts
> > lines = launchsvn("log %s" % log_opts)
>
> > @@ -679,7 +679,7 @@
> > phantom_revs = RevisionSet("%s-%s" % (begin, end)) - revs
> > reflected_revs = []
> >
> > - if opts["bidirectional"]:
> > + if opts.has_key("bidirectional") and opts["bidirectional"]:
> > report("checking for reflected changes in %d revision(s)"
> > % len(prop_changed_revs))
>
> This is also pretty weird, as opts should automatically acquires defaults for
> every option through the Option machinery. Did you investigate why it's not
> needed for any other option?

The bidirectional option is not valid for "svnmerge block", so it does
not have a default in this case. For this reason, we're forced to deal
with the possibility that the "bidirectional" key may not exist at
all.

One option: Instead of checking opts.has_key("bidirectional") and
opts["bidirectional"], we could use opts.get("bidirectional"). This
would be a bit more succinct.

Cheers,

David

--
David James -- http://www.cs.toronto.edu/~james
---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@subversion.tigris.org
For additional commands, e-mail: dev-help@subversion.tigris.org
Received on Wed Mar 1 01:44:21 2006

This is an archived mail posted to the Subversion Dev mailing list.

This site is subject to the Apache Privacy Policy and the Apache Public Forum Archive Policy.