On Tue, May 04, 2010 at 11:36:49AM +0100, Julian Foad wrote: > Wasn't the idea that the caller could choose whether the patched result > should be written straight to the target file or to somewhere else?
No, that wasn't the idea. The patched result is *always* written to tempfiles first. Always has been. It is never written "straight to the target file" while being computed. Rather, the target file is eventually overwritten with the tempfile, resulting in the application of the patched result to the working copy. (This is of course an implementation detail, but should be understood when reasoning about the patch code itself. Callers don't need to care how it is done.) The caller can suppress the application of the patched result to the working copy by passing dry_run == TRUE. The idea behind the mechanism to retrieve the tempfiles is that applications like TortoiseSVN can pass dry_run == TRUE and look at the tempfiles to see what the patched result will look like. Passing the request for access to the tempfiles alone does not imply dry_run == TRUE, but the primary use case is the dry_run == TRUE case. If dry_run == FALSE is passed, the working copy will be patched and the caller will have access to the tempfiles which replaced files in the working copy (and it's the caller's job to clean them up) -- not very exiting :) Stefan