view tests/test-ro-message @ 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 f293ad87f928
children e506c14382fd
line wrap: on
line source

#!/bin/sh
HG=hg
"$HG" init
mkdir b
echo 'Bouncy' >b/bouncy
echo 'tricycle' >b/vehicle
"$HG" add b/bouncy
"$HG" add b/vehicle
"$HG" commit -m 'Adding bouncy'
echo 'bouncy' >>b/bouncy
"$HG" commit -m 'Making it bouncier'
"$HG" update -C 0
echo 'stationary' >>b/vehicle
"$HG" commit -m 'Clarifying the vehicle.'
"$HG" update -C 1
chmod a-w b/vehicle
"$HG" update -m 2 2>&1 | sed 's|^\(.*[ 	]\).*/\([^/]*/[^/]*/[^/]*\)$|\1\2|g'