Heat the oil in a flameproof casserole, add the venison, then add the onion and bacon, and fry, stirring, until the venison is browned. Stir in the garlic and flour, then mix in the wine, stock and tomato purée. Add the rosemary and season well with salt and pepper.
Bring to the boil, stirring, then cover and transfer to a preheated oven, 160°C (325°F), Gas Mark 3, for 2 hours. Take the dish out of the oven. Heat the butter in a frying pan, add the shallots and mushrooms and fry until golden, then stir into the venison and leave to cool.
Spoon the venison mixture into a 1.2 litre (2 pint) ovenproof pie dish. Roll out the pastry on a lightly floured surface until about 5 cm (2 inches) wider than the diameter of the pie dish. Cut 2 long strips from the edges about 1 cm (½ inch) wide. Brush the dish rim with egg, press the strips on top, then brush these with egg. Lift the pie lid in place, sealing the edges together well. Trim off the excess pastry.
Flute the edge of the pastry (see