Opened 13 years ago

Closed 11 years ago

#285 closed enhancement (fixed)

copyright update writes new file twice - remove one writing

Reported by: Peter Johansson Owned by: Peter Johansson
Priority: minor Milestone: svndigest 0.9
Component: svncopyright Version: trunk
Keywords: Cc:

Description (last modified by Peter Johansson)

The copyright update writes to a temporary file in /tmp and subsequently that file is copied to the correct file name, which means the same file is written again.

Initially, the latter writing was not a copying but a moving of the file. The cheap move was then replaced with a copy because of problems with moving files across file systems (see ticket:251).

This double writing could be removed by, e.g., rather than writing to /tmp/filename write to filename~, and then simply mv filename~ filename

The reasons we cannot write to filename directly are: 1) We are reading from filename meanwhile writing, 2) if something goes wrong (!) and the copyright update is interrupted, it is nice if we haven't modified filename.

Change History (6)

comment:1 Changed 13 years ago by Peter Johansson

Description: modified (diff)

comment:2 Changed 13 years ago by Peter Johansson

I kind of like keeping tmp files in /tmp. But there is no reason to copy the file if we can rename it. We should check if we are on same file systems.

comment:3 Changed 12 years ago by Peter Johansson

I've changed my mind here: I think we should write the temporary file as where is the name of the final file.

comment:4 Changed 11 years ago by Peter Johansson

Milestone: svndigest 0.8svndigest 0.9

comment:5 Changed 11 years ago by Peter Johansson

Owner: changed from Jari Häkkinen to Peter Johansson
Status: newassigned

comment:6 Changed 11 years ago by Peter Johansson

Resolution: fixed
Status: assignedclosed

(In [1132]) when updating copyright, write to #file# and then rename that file rather than writing in /tmp which might be a a different device and rename doesn't work. fixes #285

Note: See TracTickets for help on using tickets.