The evolution of galaxy activity in massive clusters