#
# patch "ChangeLog"
# from [45d52de4c1d3b02795d3e177dc46a7868469cbb1]
# to [32b8f5570af81938c9d9ec18cc1266014cf06d17]
#
# patch "commands.cc"
# from [619c97f154a148333f4d045bfab003359c533810]
# to [afab75c11da6170ea4a46e843f53cde5c8fbc145]
#
# patch "pcdv.cc"
# from [8f5d9105a82f69c6aea06bd547679403f979846f]
# to [9e57cd05ee0304343cc53eb98a64aa0d202e4efd]
#
# patch "pcdv.hh"
# from [e53433a7651985f8a0aeff23660f7d21f40eb813]
# to [8a115dd67f2d05156cf6193834eaab0b3378f870]
#
--- ChangeLog
+++ ChangeLog
@@ -1,5 +1,10 @@
2005-06-29 Timothy Brownawell
+ * pcdv.cc: more stuff in test code (same as tests in reference impl)
+ bugfix unique_lcs, living_status, file_state
+
+2005-06-29 Timothy Brownawell
+
* pcdv.{cc,hh}: many changes, including adding test code.
Does not work properly on test code.
* commands.cc: pcdv runs new test code first
--- commands.cc
+++ commands.cc
@@ -3822,8 +3822,7 @@
"precise-cdv merge FILENAME in the two given revisions",
OPT_NONE)
{
- if (!pcdv_test())
- return;
+ pcdv_test();
if (args.size() != 3)
throw usage(name);
@@ -3895,41 +3894,7 @@
map::iterator r = files.find(right);
N(r != files.end(), F("Not found."));
vector result(l->second.conflict(r->second));
- bool lastok=false;
- for (vector::iterator i = result.begin();
- i != result.end(); ++i)
- {
- if (i->split)
- {
- if (i->left.size())
- {
- cout<<"<<<<<<<<<<"<<'\n';
- for (vector::iterator j = i->left.begin();
- j != i->left.end(); ++j)
- cout<<" "<<*j;
- }
- if (i->right.size())
- {
- cout<<">>>>>>>>>"<<'\n';
- for (vector::iterator j = i->right.begin();
- j != i->right.end(); ++j)
- cout<<" "<<*j;
- }
- lastok = false;
- }
- else
- {
- if (i->left.size())
- {
- if (!lastok)
- cout<<"=========="<<'\n';
- for (vector::iterator j = i->left.begin();
- j != i->left.end(); ++j)
- cout<<" "<<*j;
- lastok = true;
- }
- }
- }
+ show_conflict(consolidate(result));
}
--- pcdv.cc
+++ pcdv.cc
@@ -23,7 +23,7 @@
file_state::~file_state()
{
- if (weave.unique())
+ if (false && weave.unique())
{
states.reset();
std::cout<<"Destroyed file_state of "<size()
@@ -56,7 +56,7 @@
// btoa[i] = a.find(b[i]), if b[i] is unique in both
// otherwise, btoa[i] = -1
map index2;
- vector btoa(b.size());
+ vector btoa(b.size(), -1);
for (int i = 0; (unsigned int)(i) < b.size(); ++i)
{
map::iterator j = index.find(idx(b,i));
@@ -155,6 +155,7 @@
a2.push_back(idx(a, i));
for(int i = blo; i < bhi; ++i)
b2.push_back(idx(b, i));
+
unique_lcs(a2, b2, linematches);
for (vector >::iterator i = linematches.begin();
i != linematches.end(); ++i)
@@ -298,7 +299,8 @@
j != i->second.end(); ++j)
alive.erase(*j);
}
- boost::shared_ptr