view tests/test-push-hook-lock @ 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 876e4e6ad82b
children
line wrap: on
line source

#!/bin/sh
hg init 1
echo '[ui]' >> 1/.hg/hgrc
echo 'timeout = 10' >> 1/.hg/hgrc
echo foo > 1/foo
hg --cwd 1 ci -A -m foo
hg clone 1 2
hg clone 2 3
echo '[hooks]' >> 2/.hg/hgrc
echo 'changegroup.push = hg push -qf ../1' >> 2/.hg/hgrc
echo bar >> 3/foo
hg --cwd 3 ci -m bar
hg --cwd 3 push ../2