#
# patch "ChangeLog"
# from [2b37d0699ecc983fe550504e9e76b29a11947e22]
# to [3b14f264e3d6821eddbf8345b424b2068225310b]
#
# patch "rcs_import.cc"
# from [60f5ef2fcd089c3f6bde86d3dcca879dabe58d5b]
# to [179647e7b3dc2d46d265567204cf537c375ae893]
#
# patch "tests/t_cvsimport2.at"
# from [4641874ff2fbedf55b84c1169dd86e4d2354c36b]
# to [0a3df708fccb7ffd262b47a5b7149a3b69115170]
#
--- ChangeLog
+++ ChangeLog
@@ -1,3 +1,11 @@
+2005-04-26 Nathaniel Smith
+
+ * rcs_import.cc (struct cvs_key, process_branch): Fix
+ indentation.
+ (build_change_set): Handle the case where a file is "added dead".
+
+ * tests/t_cvsimport2.at: Un-XFAIL, improve description.
+
2005-04-25 Nathaniel Smith
* tests/t_i18n_file_data.at: New test.
--- rcs_import.cc
+++ rcs_import.cc
@@ -72,21 +72,21 @@
if (labs(time - other.time) > constants::cvs_window)
return false;
for (map::const_iterator it = files.begin(); it!=files.end(); it++)
- {
- map::const_iterator otherit;
-
-L(F("checking %s %s\n") % it->first % it->second);
- otherit = other.files.find(it->first);
- if (otherit != other.files.end() && it->second!=otherit->second)
{
- L(F("!similar_enough: %d/%d\n") % id % other.id);
- return false;
+ map::const_iterator otherit;
+
+ L(F("checking %s %s\n") % it->first % it->second);
+ otherit = other.files.find(it->first);
+ if (otherit != other.files.end() && it->second!=otherit->second)
+ {
+ L(F("!similar_enough: %d/%d\n") % id % other.id);
+ return false;
+ }
+ else if (otherit != other.files.end())
+ {
+ L(F("Same file, different version: %s and %s\n") % it->second % otherit->second);
+ }
}
-else if (otherit != other.files.end())
-{
-L(F("Same file, different version: %s and %s\n") % it->second % otherit->second);
-}
- }
L(F("similar_enough: %d/%d\n") % id % other.id);
return true;
}
@@ -515,8 +515,8 @@
I(r.deltas.find(curr_version) != r.deltas.end());
bool live_p = r.deltas.find(curr_version)->second->state != "dead";
s->in_edges.insert(cvs_file_edge(curr_id, cvs.curr_file, false,
- curr_id, cvs.curr_file, live_p,
- cvs));
+ curr_id, cvs.curr_file, live_p,
+ cvs));
++cvs.n_versions;
}
}
@@ -1136,10 +1136,22 @@
file_id fid(cvs.file_version_interner.lookup(f->child_version));
file_path pth(cvs.path_interner.lookup(f->child_path));
if (!f->child_live_p)
- {
- L(F("deleting entry state '%s' on '%s'\n") % fid % pth);
- cs.delete_file(pth);
- }
+ {
+ if (f->parent_live_p)
+ {
+ L(F("deleting entry state '%s' on '%s'\n") % fid % pth);
+ cs.delete_file(pth);
+ }
+ else
+ {
+ // it can actually happen that we have a file that went from
+ // dead to dead. when a file is created on a branch, cvs first
+ // _commits a deleted file_ on mainline, and then branches from
+ // it and resurrects it. In such cases, we should just ignore
+ // the file, it doesn't actually exist. So, in this block, we
+ // do nothing.
+ }
+ }
else
{
manifest_map::const_iterator i = state_map.find(pth);
--- tests/t_cvsimport2.at
+++ tests/t_cvsimport2.at
@@ -1,13 +1,11 @@
-AT_SETUP([test failing cvs import (Attic)])
+AT_SETUP([cvs_import with file added on a branch])
MONOTONE_SETUP
-# This test imports a cvs archive with files in the Attic which fails
-#monotone: fatal: std::logic_error: change_set.cc:2546: invariant 'I(b.rearrangement.deleted_files.empty())' violated
+# This tests the case where a file was added on a branch in CVS; CVS
+# records this in a strange way (with a delete of the non-existent
+# file on mainline, followed by an add of the file on the branch).
+# Make sure we handle it correct.
-# reported by: address@hidden 15.04.2005 02:45
-# This test is a bug report.
-AT_XFAIL_IF(true)
-
AT_DATA(prepare.sh,[#!/bin/sh
export CVSROOT=$PWD/cvsroot