The theory was rolling lines that stayed together. When Roman legions got separated into small units of non uniformed combatants, they were in deep trouble. In the front of the line, complete uniformity would never be complete, but when there was trouble, the men in the rear pushed to the front to try to keep things together. Nothing ever worked quite as simply as this, but it gives the basic impression I hope.