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

Re: svn commit: rev 5762 - branches/cvs2svn-kfogel/tools/cvs2svn

From: Greg Stein <gstein_at_lyra.org>
Date: 2003-04-29 23:52:21 CEST

On Tue, Apr 29, 2003 at 03:03:24PM -0500, kfogel@tigris.org wrote:
>...
> + if is_executable:
> + self.dumpfile.write('K 14\n')
> + self.dumpfile.write('svn:executable\n')
> + self.dumpfile.write('V 1\n')
> + self.dumpfile.write('*\n')

Style-nit-alert: rather than a bunch of .write() calls, I tend to do:

  self.dumpfile.write('K 14\n'
                      'svn:executable\n'
                      'V 1\n'
                      '*\n')

The standard string pasting makes that work quite well, and the parens let
the newlines slide right in without a hassle.

>...
> + # The content length is the length of property data, text data,
> + # and any metadata around/inside around them.
> + self.dumpfile.write(string.rjust(str(length + props_len), 16))

I've never been clear why string.rjust exists. You can just do:

  self.dumpfile.write('%16d' % (length + props_len))

Cheers,
-g

-- 
Greg Stein, http://www.lyra.org/
---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@subversion.tigris.org
For additional commands, e-mail: dev-help@subversion.tigris.org
Received on Tue Apr 29 23:52:22 2003

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.