[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, version 4

From: <kfogel_at_collab.net>
Date: 2005-07-11 17:33:27 CEST

Vivek <vivek@collab.net> writes:
> > Thoughts?
> Rather than hard setting the svn:date why don't we pget svn:date and
> manipulate that date so as to match the 'date --iso-8601=seconds'

Hey, great idea!

> Here is how:
>
> #----------------------------------------------------------------------
> # The output of GNU date was not being accepted by svn commands
> # Test the fix.
> def cat_with_date_option(sbox):
> "use GNU date command in revision input"
> sbox.build()
>
> wc_dir = sbox.wc_dir
>
> mu_path = os.path.join(wc_dir, 'A', 'mu')
> # Create the revprop-change hook
> if os.name == 'posix':
> hook = os.path.join(svntest.main.current_repo_dir, 'hooks',
> 'pre-revprop-change')
> open(hook, 'w').write("#!/bin/sh\n\nexit 0\n")
> os.chmod(hook, 0755)
> elif sys.platform == 'win32':
> hook = os.path.join(svntest.main.current_repo_dir,
> 'hooks', 'pre-revprop-change.bat')
> open(hook, 'w').write("@exit 0\n")
>
> out, err = svntest.main.run_svn(1, 'pget', "--revprop", "-r", '1',
> 'svn:date', sbox.wc_dir)
> if err:
> raise svntest.Failure
>
> # The string we need should match 'date --iso-8601=seconds'
> date_var = str(out).split('.')[0].split("'")[1].split('-',1)
> date_var[0] = str(string.atoi(date_var[0]) + 1)
> date_var = string.join(date_var,'-') + "+0530"
>
> # The Success Case: output and no errors.
> svntest.actions.run_and_verify_svn('cat a file using GNU date',
> ["This is the file 'mu'.\n"],None,
> 'cat', '-r', '{' + date_var + '}',
> mu_path)

Okay, I get it. But, where did the hardcoded "+0530" come from? Is
that just a temporary hack because you're 5:30h ahead of GMT, but in
the real code that'll be handled dynamically?

-Karl

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@subversion.tigris.org
For additional commands, e-mail: dev-help@subversion.tigris.org
Received on Mon Jul 11 18:23:27 2005

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