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

Re: [1990]:Re: [PATCH] change-svn-wc-format.py

From: Edmund Wong <edmund_at_belfordhk.com>
Date: Sat, 28 Mar 2009 11:46:32 +0800

On Fri, 27 Mar 2009 14:36:52 +0000, Stefan Sperling wrote
> On Fri, Mar 27, 2009 at 12:52:04PM +0800, Edmund Wong wrote:
> > Here's the patch to create the format file in the WC .svn folder.
>
> It does not look like you used 'svn diff' to produce this patch.
>
My mistake. I used TortoiseSVN's diff feature. Anyway, I'll post
a new diff with the changes.

> The above change is probably due to mismatching end-of-line markers?
> Does that also happen with 'svn diff'?
>
Nope. As mentioned above, my bad.
 
> Please use spaces after commas for consistency:
> > +
> > +
>
> Adding the two empty lines above might not be necessary.
> The rest of the code also uses spaces around operators like +.
>

I've fixed the space issues.

> > + # Overwrite all bytes of the format number.
> > + if os.path.exists(self.path):
> > + format = open(self.path,"r")
> > + os.chmod(self.path, 0600)
>
> Will the chmod work on Windows?
>

Nope. It doesn't work, or rather, it has no affect,
as far as I know. (Ran this script on a Vista machine.)

Should I test for OS?

> > + format_line = format.readline()
> > + format_line.rstrip()
> > + format_nbr_old = int(format_line)
> > + if format_nbr_old < format_nbr:
> > + # Upgrading version is not supported? (Please review.)
> > + raise UnrecognizedWCFormatException(format_nbr_old,self.path)
>
> Changing working copy format should work either way, up to 1.6.
> This script will never be able to support 1.7.
>
I understand. So basically I take out the last three lines above?

> Note that not all versions of Subversion actually read and interpret
> the format file. I'm not sure when we stopped reading it, but the
> revision log of subversion/libsvn_wc/log.c might tell you.

>From Greg Stein's post, it's likely that it's only up to 1.4.
Or did I misunderstand?

> > + if verbosity >= 2:
> > + print("Downgraded WC format.")
>
> This message sounds like the whole operation of downgrading
> the working copy was complete. Is this appropriate here?

I fixed it to "format file has been updated." Is this a better
message?

Thanks for the comments.

Edmund

--
"Pax tecum"
------------------------------------------------------
http://subversion.tigris.org/ds/viewMessage.do?dsForumId=462&dsMessageId=1451773
Received on 2009-03-28 11:57:53 CET

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.