author | Shawn O. Pearce <spearce@spearce.org> | |
Wed, 7 Mar 2007 23:05:38 +0000 (18:05 -0500) | ||
committer | Shawn O. Pearce <spearce@spearce.org> | |
Wed, 7 Mar 2007 23:05:38 +0000 (18:05 -0500) | ||
commit | 60b9004cdb106ce56589cbe587b6b5e7d6ad3cf9 | |
tree | 8d335936637646866e3728bc4cab28d8c4db2661 | tree | snapshot |
parent | 93e72d8d8fbfbbf28abee82c3e769337d7b940ec | commit | diff |
Use atomic updates to the fast-import mark file
When we allow fast-import frontends to reload a mark file from a
prior session we want to let them use the same file as they exported
the marks to. This makes it very simple for the frontend to save
state across incremental imports.
But we don't want to lose the old marks table if anything goes wrong
while writing our current marks table. So instead of truncating and
overwriting the path specified to --export-marks we use the standard
lockfile code to write the current marks out to a temporary file,
then rename it over the old marks table.
Signed-off-by: Shawn O. Pearce <spearce@spearce.org>
When we allow fast-import frontends to reload a mark file from a
prior session we want to let them use the same file as they exported
the marks to. This makes it very simple for the frontend to save
state across incremental imports.
But we don't want to lose the old marks table if anything goes wrong
while writing our current marks table. So instead of truncating and
overwriting the path specified to --export-marks we use the standard
lockfile code to write the current marks out to a temporary file,
then rename it over the old marks table.
Signed-off-by: Shawn O. Pearce <spearce@spearce.org>
fast-import.c | diff | blob | history |