- set_difference( backed_up.begin(), backed_up.end(),
- current.begin(), current.end(),
- inserter( updated, updated.begin() ),
- cmp );
+ set_union( current.begin(), current.end(),
+ backed_up.begin(), backed_up.end(),
+ inserter( updated, updated.begin() ),
+ cmp );
+
+ { // This little block will copy the last_backup_date from the second set to the first
+ file_set updated_mirror;
+ set_union( current.begin(), current.end(),
+ backed_up.begin(), backed_up.end(),
+ inserter( updated_mirror, updated_mirror.begin() ),
+ cmp );
+
+ // TODO Now we need to copy the last_backup_date from
+ file_set::iterator i = updated.begin(), j = updated_mirror.begin();
+ for( ; i != updated.end(); ++i, ++j ) {
+ (*i)->setLastBackupDate( (*j)->getLastBackupDate() );
+ }
+ }