monotone-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Monotone-devel] cvsimport branch reconstruction


From: Markus Schiltknecht
Subject: [Monotone-devel] cvsimport branch reconstruction
Date: Fri, 07 Apr 2006 17:11:25 +0200

Hi,

I've just pushed the branch
net.venge.monotone.cvsimport-branch-reconstruction up to venge.net.
Since the last incarnation, the algorithm for finding the branchpoint
has changed significantly. I'll try to explain shortly:

During RCS file parsing, for every branch three times are extracted, if
available:

a) the time of the last commit before branching
b) the time of the first commit in the branch
c) the time of the commit following the branching in the parent

It is obvious, that branching must have occured after a) but before b)
and c). If neigther b) nor c) is given the branch is imported
unconnected. Likewise if a) is not lower than b) or c).

After having parsed all RCS files, the branching time is written back
into the branch lineages, where not only commit events, but also branch
events (struct cvs_event) are stored. The lineage then gets sorted.
Conclusively it now consists of commit and branch events for every file.

Since the branch events are well positioned between the right commits,
it's simple to collect them into a cvs_cluster, which can now also stand
for branches as well as commits.

The cluster_consumer then simply handles a cvs_cluster of type branch by
storing the revision id of the last commit as the parent revision id for
the branch in question.

For empty branches, I do insert a 'beginning of branch'-pseudo commit.
For branches with commits I don't because I would have to invent a time
for such a pseudo commit (cvs does not store that).

Limitations of this algorithm:

1) a 'commit', 'branch' and 'commit (on branch or parent)' should be
some seconds apart.

2) because of 1), the tests/t_cvsimport_branch{,2}.at have to pause
between cvs commits. This dramatically increases test duration of these
tests. I should probably provide a pre-prepared cvs repository.

3) branches can still remain unconnected, if the above condition fails.
I don't know how else to solve that, except...


A general rcs_import.cc question I'm now thinking about: is the time of
commit or branch events enough information to sort by? There are well
enough cvs repositories around (I'm fiddling with the PostgreSQL CVS
repository) which obviously have gotten hand-crafted 'tunings'. The date
information might provide different information than the RCS version.
Isn't it better to rely more on the RCS version information?

Anyway, please test, comment, include, drop, burn or blow away my second
attempt of an implementation for cvsimport branch reconstruction.

Regards

Markus






reply via email to

[Prev in Thread] Current Thread [Next in Thread]