You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@subversion.apache.org by J Robert Ray <jr...@imageworks.com> on 2004/10/14 01:09:13 UTC

checkout by date and cvs2svn

Hi folks,

I just had a fellow dev point out to me that checkout by date doesn't 
work in our repository (i.e. svn checkout -r {2004-10-01} http://...).

We have been migrating from cvs on a project-by-project basis, and I 
have been using cvs2svn to import slices of our cvs repository one at a 
time.

As a result, the dates of the revisions in our repository are not 
strictly in chronological order:

------------------------------------------------------------------------
r52883 | (no author) | 1997-09-19 13:58:59 -0700 (Fri, 19 Sep 1997) | 1 line
Changed paths:
    A /foo/branches
    A /foo/tags
    A /foo/trunk

New repository initialized by cvs2svn.
------------------------------------------------------------------------
r52882 | jrray | 2004-10-08 17:57:47 -0700 (Fri, 08 Oct 2004) | 1 line
Changed paths:
    A /foo

importing foo from cvs
------------------------------------------------------------------------


svn_repos_dated_revision() does a binary search across the revisions 
searching for a date, assuming of course that the dates are ordered.  I 
like the comments in that file:

    If some moron comes along and sets a bogus datestamp, this routine
    might not work right.

I guess that's me. ;)  I have to believe that the way I'm using cvs2svn 
is not that uncommon.

Any advice?  Thanks,

- Robert




---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@subversion.tigris.org
For additional commands, e-mail: users-help@subversion.tigris.org

Re: checkout by date and cvs2svn

Posted by J Robert Ray <jr...@imageworks.com>.
Chip Turner wrote:
> J Robert Ray <jr...@imageworks.com> writes:
> 
> 
>>Hi folks,
>>
>>I just had a fellow dev point out to me that checkout by date doesn't
>>work in our repository (i.e. svn checkout -r {2004-10-01} http://...).
>>
>>We have been migrating from cvs on a project-by-project basis, and I
>>have been using cvs2svn to import slices of our cvs repository one at
>>a time.
>>
>>As a result, the dates of the revisions in our repository are not
>>strictly in chronological order:
> 
> 
> We do the exact same thing -- import portions at a time, subtree by
> subtree, and our revisions are no longer in chronological order,
> either.
> 
> I don't see there really being a good solution short of renumbering a
> repo by date... but that could get really messy.  Imagine this:
> 
> /foo/bar - created on 09/12/04, r12
> /foo/bar/blip - imported from cvs, dates range from 01/01/01 to 
>                 01/01/03, r13 through r1000
> 
> what revision should /foo/bar be created in, if the repo were
> restructured and sorted strictly by date?  Or would its revision
> entirely disappear, perhaps being subsumed by the cvs import dirs?

This sequence of events:

09/12/04, r12: mkdir /foo/bar

01/01/01, r13: mkdir /foo/bar/blip [start of import]
...
01/01/03, r1000: [end of import]

could be resorted into this:

01/01/01, r12: mkdir /foo/bar [manufactured event, old date]

01/01/01, r13: mkdir /foo/bar/blip [start of import]
...
01/01/03, r1000: [end of import]

09/12/04, r1001: mv /foo/bar/blip /tmp

09/12/04, r1002: rm /foo/bar

09/12/04, r1003: mkdir /foo/bar [originally r12]

09/12/04, r1004: mv /tmp /foo/bar/blip

Renumbering commits (reassigning revision numbers) is not very 
desireable, but it does seem possible to reorder the events to keep 
things chronological, while preserving all the events.  Maybe this last 
point isn't important.

My first idea was to import into a temporary directory, and then move 
into place, avoiding the rm+mkdir game, but that would make it 
impossible to check the tree out from the real location from a point in 
time during the import.

> 
> Perhaps cvs2svn shouldn't be forging dates at all, instead storing
> original dates in a cvs2svn:date property or something... especially
> if code in svn is making an assumption that revision ordering and date
> ordering are the same.

I feel the commit date from cvs is an important piece of metadata and it 
would be best to have the svn commit date match.  Given that the goal is 
to be able to checkout code based on date, it would be useless to not 
have the original cvs commit dates.  Or if they were stuffed in a 
property, the original problem still applies.

- Robert

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@subversion.tigris.org
For additional commands, e-mail: users-help@subversion.tigris.org

Re: checkout by date and cvs2svn

Posted by Chip Turner <ct...@redhat.com>.
J Robert Ray <jr...@imageworks.com> writes:

> Hi folks,
>
> I just had a fellow dev point out to me that checkout by date doesn't
> work in our repository (i.e. svn checkout -r {2004-10-01} http://...).
>
> We have been migrating from cvs on a project-by-project basis, and I
> have been using cvs2svn to import slices of our cvs repository one at
> a time.
>
> As a result, the dates of the revisions in our repository are not
> strictly in chronological order:

We do the exact same thing -- import portions at a time, subtree by
subtree, and our revisions are no longer in chronological order,
either.

I don't see there really being a good solution short of renumbering a
repo by date... but that could get really messy.  Imagine this:

/foo/bar - created on 09/12/04, r12
/foo/bar/blip - imported from cvs, dates range from 01/01/01 to 
                01/01/03, r13 through r1000

what revision should /foo/bar be created in, if the repo were
restructured and sorted strictly by date?  Or would its revision
entirely disappear, perhaps being subsumed by the cvs import dirs?

Perhaps cvs2svn shouldn't be forging dates at all, instead storing
original dates in a cvs2svn:date property or something... especially
if code in svn is making an assumption that revision ordering and date
ordering are the same.

Chip

-- 
Chip Turner                   cturner@redhat.com
                              Red Hat, Inc.

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@subversion.tigris.org
For additional commands, e-mail: users-help@subversion.tigris.org