#
#
# patch "ChangeLog"
# from [b931b2587c40359b3fa7a71ce9f9f6bb46b93113]
# to [a50f13fec1e9d8414bb18e29f6269c721d037683]
#
# patch "rcs_import.cc"
# from [7554d086dfaa1bc452171314314cb8c1bddf5167]
# to [2126a8abbdbecc7d57d75e89f03ca875a3bcba67]
#
============================================================
--- ChangeLog b931b2587c40359b3fa7a71ce9f9f6bb46b93113
+++ ChangeLog a50f13fec1e9d8414bb18e29f6269c721d037683
@@ -1,5 +1,11 @@
2006-04-04 Markus Schiltknecht
+ * rcs_import.cc: modified import order: importing the
+ trunk first, then all branches. This in preparation
+ for branch reconstruction
+
+2006-04-04 Markus Schiltknecht
+
* rcs_import.cc: added step 4: find the last cvs_cluster
for ET_BRANCH events.
============================================================
--- rcs_import.cc 7554d086dfaa1bc452171314314cb8c1bddf5167
+++ rcs_import.cc 2126a8abbdbecc7d57d75e89f03ca875a3bcba67
@@ -1100,9 +1100,6 @@
cluster_consumer cons(cvs, app, branchname, *branch, n_revs);
unsigned long commits_remaining = branch->lineage.size();
- // step 1: sort the lineage
- stable_sort(branch->lineage.begin(), branch->lineage.end());
-
for (vector::const_iterator i = branch->lineage.begin();
i != branch->lineage.end(); ++i)
{
@@ -1312,20 +1309,20 @@
ticker n_revs(_("revisions"), "r", 1);
- while (cvs.branches.size() > 0)
+ // first, sort the lineages of the trunk and all branches
+ L(FL("sorting lineage of trunk\n"));
+ stable_sort(cvs.trunk->lineage.begin(), cvs.trunk->lineage.end());
+ for(map >::const_iterator i = cvs.branches.begin();
+ i != cvs.branches.end(); ++i)
{
- transaction_guard guard(app.db);
- map >::const_iterator i = cvs.branches.begin();
string branchname = i->first;
shared_ptr branch = i->second;
- L(FL("branch %s has %d entries\n") % branchname % branch->lineage.size());
- import_branch(cvs, app, branchname, branch, n_revs);
- // free up some memory
- cvs.branches.erase(branchname);
- guard.commit();
+ L(FL("sorting lineage of branch %s\n") % branchname);
+ stable_sort(branch->lineage.begin(), branch->lineage.end());
}
+ // import trunk first
{
transaction_guard guard(app.db);
L(FL("trunk has %d entries\n") % cvs.trunk->lineage.size());
@@ -1333,6 +1330,25 @@
guard.commit();
}
+ while (cvs.branches.size() > 0)
+ {
+ transaction_guard guard(app.db);
+ map >::const_iterator i;
+ shared_ptr branch;
+
+ i = cvs.branches.begin();
+ branch = i->second;
+
+ string branchname = i->first;
+
+ L(FL("branch %s has %d entries\n") % branchname % branch->lineage.size());
+ import_branch(cvs, app, branchname, branch, n_revs);
+
+ // free up some memory
+ cvs.branches.erase(branchname);
+ guard.commit();
+ }
+
// now we have a "last" rev for each tag
{
ticker n_tags(_("tags"), "t", 1);