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

Re: Behavior check: svnadmin load of revisions with no datestamp

From: C. Michael Pilato <cmpilato_at_collab.net>
Date: 2007-02-27 16:12:22 CET

Ben Collins-Sussman wrote:
> On 2/26/07, C. Michael Pilato <cmpilato@collab.net> wrote:
>
>> But I think you misunderstood my question. I am taking for granted
>> that the
>> ability to have a missing svn:date is *not* a bug. My question is,
>> "In such
>> a case, should a date suddenly appear just because you dump and load the
>> repository data?" I think not. *That's* the bug I'm talking about.
>
> I think you've identified a bug, yeah.
>
> In that same vein, what if a revision has no svn:author property?
> That's far more common (and less havoc-wreaking) than the 'no
> svn:date' scenario. In that case, might 'svnadmin load' (or even
> 'svnsync sync') be accidentally creating svn:author properties?

No, a missing author is fine because the filesystem code doesn't assume
there is an author for every commit. I'm sure that svn:date is a special
case here because that property is the one property that Subversion creates
itself at txn-start time, and rewrites itself at txn-commit time.

I haven't tested this, but I suspect the patch is as simple as the following:

Index: subversion/libsvn_repos/load.c
===================================================================
--- subversion/libsvn_repos/load.c (revision 23433)
+++ subversion/libsvn_repos/load.c (working copy)
@@ -1219,11 +1219,13 @@

   /* Grrr, svn_fs_commit_txn rewrites the datestamp property to the
      current clock-time. We don't want that, we want to preserve
- history exactly. Good thing revision props aren't versioned! */
- if (rb->datestamp)
- SVN_ERR(svn_fs_change_rev_prop(pb->fs, *new_rev,
- SVN_PROP_REVISION_DATE, rb->datestamp,
- rb->pool));
+ history exactly. Good thing revision props aren't versioned!
+ Note that if rb->datestamp is NULL, that's fine -- if the dump
+ data doesn't carry a datestamp, we want to preserve that fact in
+ the load. */
+ SVN_ERR(svn_fs_change_rev_prop(pb->fs, *new_rev,
+ SVN_PROP_REVISION_DATE, rb->datestamp,
+ rb->pool));

   if (*new_rev == rb->rev)
     {

-- 
C. Michael Pilato <cmpilato@collab.net>
CollabNet   <>   www.collab.net   <>   Distributed Development On Demand

Received on Tue Feb 27 16:12:50 2007

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.