AU: fix delta generation when running out of scratch.
When running out of scratch, deltas were incorrectly generated. The
issue is that cuts used to be processed in arbitrary order, so
sometimes a cut would be processed (thus having temp blocks
allocated), and later another cut would be impossible to process, and
then the node in question would be converted to a REPLACE
operation. That's fine, but we weren't deleting the graph nodes that
moved data aside. Thus, we would generate a delta w/ extra ops that
were moving data around(!!).
This change causes us to prcocess all cuts for a node together, so
they all succeed or fail.
BUG=8063
TEST=unittests, generated/applied delta locally
Review URL: http://codereview.chromium.org/3997007
Change-Id: I5a9a1b962659bdeec7fb60baced02d5dcb9c2496
diff --git a/delta_diff_generator.h b/delta_diff_generator.h
index 3156fd6..067ce1f 100644
--- a/delta_diff_generator.h
+++ b/delta_diff_generator.h
@@ -192,7 +192,7 @@
off_t* data_file_size,
std::vector<Vertex::Index>* op_indexes,
std::vector<std::vector<Vertex::Index>::size_type>* reverse_op_indexes,
- std::vector<CutEdgeVertexes>& cuts);
+ const std::vector<CutEdgeVertexes>& cuts);
// Given a new rootfs and kernel (|new_image|, |new_kernel_part|), Reads them
// sequentially, creating a full update of chunk_size chunks. Populates