Checkout tree and write revision file