Opened 16 years ago
Closed 13 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 )
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 16 years ago by
Description: | modified (diff) |
---|
comment:2 Changed 15 years ago by
comment:3 Changed 14 years ago by
I've changed my mind here: I think we should write the temporary file as #file.name#
where file.name
is the name of the final file.
comment:4 Changed 14 years ago by
Milestone: | svndigest 0.8 → svndigest 0.9 |
---|
comment:5 Changed 13 years ago by
Owner: | changed from Jari Häkkinen to Peter Johansson |
---|---|
Status: | new → assigned |
comment:6 Changed 13 years ago by
Resolution: | → fixed |
---|---|
Status: | assigned → closed |
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.