Quantum statistics and spacetime surgery