diff options
author | Jean Delvare <jdelvare@suse.de> | 2009-06-17 12:49:46 +0200 |
---|---|---|
committer | Andreas Gruenbacher <agruen@suse.de> | 2009-06-17 12:49:46 +0200 |
commit | 512ac70bd4aee8696b6091875808a52d2af3540e (patch) | |
tree | f22bebbf4c4e5eb6c108bb8437017dba01feb707 /test/mail.test | |
parent | 2d14c314da040244ce65069d5723fa3a51db3e6e (diff) | |
download | quilt-512ac70bd4aee8696b6091875808a52d2af3540e.tar.gz |
"quilt revert" accidentally creates a hard link, it shouldn't do that.
I think the reason is that apply_patch_temporarily() uses backup-files
to create the temporary files, and by default backup-files uses hard
links. For files which are modified by the patch, this isn't a problem
because patch will unlink the file before modifying it. But for files
which are not modified by the patch, the hard link is preserved.
Then quilt revert also makes a hard link to restore the file, on the
assumption that the temporary copy will be deleted right away. At
this point, files not modified by the patch will have a link count
of 3 (.pc/<patch>/<file>, d.*/<file> and <file>). When the temporary
file is deleted, the link count is still 2 (.pc/<patch>/<file> and
<file>).
A simple way to fix this is to always use cp instead of ln when
restoring the files. Performance is not as good, but at least it is
always correct. We could optimize the code to use ln when possible
and cp for the other cases, but honestly I don't think it is worth
the extra complexity. The speed of "quilt revert" is hardly
critical, given how infrequently this command is used.
Diffstat (limited to 'test/mail.test')
0 files changed, 0 insertions, 0 deletions