view tests/test-revert-unknown @ 2076:d007df6daf8e

Create an atomic opener that does not automatically rename on close The revlog.checkinlinesize() uses an atomic opener to replace the index file after converting it from inline to traditional .i and .d files. If this operation is interrupted, the atomic file class can overwrite a valid file with a partially written one. This patch introduces an atomic opener that does not automatically replace the destination file with the tempfile. This way an interrupted checkinlinesize() call turns into a noop.
author mason@suse.com
date Tue, 04 Apr 2006 16:38:44 -0400
parents 7544700fd931
children
line wrap: on
line source

#!/bin/sh

hg init
touch unknown

touch a
hg add a
hg ci -m "1" -d "1000000 0"

touch b
hg add b
hg ci -m "2" -d "1000000 0"

echo %% Should show unknown
hg status
hg revert -r 0
echo %% Should show unknown and b removed
hg status
echo %% Should show a and unknown
ls