You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@subversion.apache.org by Barry Scott <ba...@barrys-emacs.org> on 2007/05/10 23:04:33 UTC
date parsing problem
In pysvn I use svn_parse_date to convert the string date from
svn_client_log
into apr_time_t.
One user reports that the dates are not getting converted.
He used vss2svn to create the repos with these bad dates.
Here is a log entry my user found is causing the problem.
svn log -r {2002-03-05}:{2002-03-01} --xml file://localhost/p:/svn/
produtos
<?xml version="1.0"?>
<log>
<logentry
revision="2772">
<author>paulo</author>
<date>2002-03-04T19:57:0.000030Z</date>
<msg>Checked in $/CardioMg/TransTel</msg>
</logentry>
<logentry
revision="2771">
<author>paulo</author>
<date>2002-03-04T18:48:0.000028Z</date>
<msg>Checked in $/CardioMg/Recorder</msg>
</logentry>
I'm guessing that the issue is that there is only 1 digit for the
seconds where
as iso 8601 mandates 2 digits.
At this point we have a bad date and svn_parse_date says it cannot
parse it.
No problem. But it seems that the svn command is parsing these dates
so that
it can support revision date ranges.
Am I right that these are not iso 8601 format date?
Is it your intention that these almost iso 8601 dates should be
supported?
If so why doesn't svn_parse_date support them?
Barry
---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@subversion.tigris.org
For additional commands, e-mail: dev-help@subversion.tigris.org
Re: date parsing problem
Posted by Barry Scott <ba...@barrys-emacs.org>.
On May 11, 2007, at 07:26, Karl Fogel wrote:
> Barry Scott <ba...@barrys-emacs.org> writes:
>> In pysvn I use svn_parse_date to convert the string date from
>> svn_client_log
>> into apr_time_t.
>>
>> One user reports that the dates are not getting converted.
>> He used vss2svn to create the repos with these bad dates.
>
> While there might be an argument for making the Subversion date parser
> more tolerant, it does seem like this is a bug in vss2svn, which is a
> separate project. Subversion is only responsible for the repositories
> it creates. If some other tool creates a repository that looks a lot
> like a Subversion repository (except that it's not, quite, because it
> uses a different date format), Subversion may not be able to parse
> that repository.
I totally agree and told my user the same.
However the key question is the claim by my user that only pysvn
fails on this bad repos but that TSVN works and SVN command line works.
This does not make sense to me given svn_parse_date fails.
Barry
---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@subversion.tigris.org
For additional commands, e-mail: dev-help@subversion.tigris.org
Re: date parsing problem
Posted by Karl Fogel <kf...@red-bean.com>.
Barry Scott <ba...@barrys-emacs.org> writes:
> In pysvn I use svn_parse_date to convert the string date from
> svn_client_log
> into apr_time_t.
>
> One user reports that the dates are not getting converted.
> He used vss2svn to create the repos with these bad dates.
While there might be an argument for making the Subversion date parser
more tolerant, it does seem like this is a bug in vss2svn, which is a
separate project. Subversion is only responsible for the repositories
it creates. If some other tool creates a repository that looks a lot
like a Subversion repository (except that it's not, quite, because it
uses a different date format), Subversion may not be able to parse
that repository.
However, just write a script to go through the repository, changing
the svn:date revision properties in the obvious way, that should fix
it. Do
search://subversion revprops/
for more on them :-).
Best,
-Karl
> Here is a log entry my user found is causing the problem.
>
> svn log -r {2002-03-05}:{2002-03-01} --xml file://localhost/p:/svn/
> produtos
> <?xml version="1.0"?>
> <log>
> <logentry
> revision="2772">
> <author>paulo</author>
> <date>2002-03-04T19:57:0.000030Z</date>
> <msg>Checked in $/CardioMg/TransTel</msg>
> </logentry>
> <logentry
> revision="2771">
> <author>paulo</author>
> <date>2002-03-04T18:48:0.000028Z</date>
> <msg>Checked in $/CardioMg/Recorder</msg>
> </logentry>
>
> I'm guessing that the issue is that there is only 1 digit for the
> seconds where
> as iso 8601 mandates 2 digits.
>
> At this point we have a bad date and svn_parse_date says it cannot
> parse it.
> No problem. But it seems that the svn command is parsing these dates
> so that
> it can support revision date ranges.
>
> Am I right that these are not iso 8601 format date?
> Is it your intention that these almost iso 8601 dates should be
> supported?
> If so why doesn't svn_parse_date support them?
>
> Barry
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: dev-unsubscribe@subversion.tigris.org
> For additional commands, e-mail: dev-help@subversion.tigris.org
---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@subversion.tigris.org
For additional commands, e-mail: dev-help@subversion.tigris.org