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

Re: [PATCH] date_tests.py

From: Vivek <vivek_at_collab.net>
Date: 2005-06-17 05:21:16 CEST

Thanks for the review Fitz. I had sent this patch as a follow up of
issue #2301. But since there is going to be a new file created, some
further date related tests were also added.

On Thu, 2005-06-16 at 23:32, Brian W. Fitzpatrick wrote:
> Comments inline
>
> > +
> > + for i in range(0,10):
>
> Don't use 10, use len(time_array)
OK.
>
> > + out, err = svntest.main.run_svn(None,'log', mu_path, '-r', '{' +
> > + str(time_array[i]) + '}'
> > + )
> > + if err != '' and out[3] != 'Log message for revision 1.\n' :
>
> instead of '!=' use 'if not' ...
OK.
>
> > + raise svntest.Failure
> > +
> >
> +#----------------------------------------------------------------------
> > +# The output of GNU date was not being accepted by svn commands
> > +# Test the fix.
> >
>
> Why are you using popen for this instead of the python time functions?

This is a specific test for the GNU date/time bug. The relavent post is
http://svn.haxx.se/dev/archive-2005-04/1361.shtml. This test is very
platform specific.

> > + # Create the revprop-change hook
> > + if os.name == 'posix':
> > + hook = os.path.join(svntest.main.current_repo_dir, 'hooks',
> > + 'pre-revprop-change')
> > + svntest.main.file_append(hook, "#!/bin/sh\n\nexit 0\n")
>
> Why are you using svntest.main.file_append here instead of open().write
> ('foo')?

This was shamelessly adopted from prop_tests.py

>
> > + os.chmod(hook, 0755)
> > + elif sys.platform == 'win32':
> > + hook = os.path.join(svntest.main.current_repo_dir,
> > + 'hooks', 'pre-revprop-change.bat')
> > + svntest.main.file_append(hook, "@exit 0\n")
>
> Same here.
>
> > + # Test: everything ok?
> > + arg = time.strftime('%Y-%m-%d %H:%M',t)
>
> Here you use strftime to get the time and above you use popen. Why?

Here I need to pass a valid date to subversion. Since 't' has already
been formatted to be a valid date, I am using that.

>
> -Fitz
Thanks,
Vivek
 

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@subversion.tigris.org
For additional commands, e-mail: dev-help@subversion.tigris.org
Received on Fri Jun 17 05:21:20 2005

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