Hammer forging does not start with bar stock, it starts with tubing or a steel spud that has a hole drilled in it for the bore-shaped mandrel that will be the bore and rifling once the barrel is finished. In "cold hammer forging" the hammers rotate around the axis of the spud and hammer on the barrel material, forcing it down to the mandrel and impressing the rifling on the inner surface of the tube formed as the metal is displaced along the mandrel. The material gets quite warm as this is happening, and the metal is pushed and shaped. The interior finish on the bore and grooves is quite smooth to the eye (borescoping shows otherwise) and is stress-hardened due to the hammers' action. These barrels are typically straightened before use.The long steel bar stock was hardened and tempered before any work was done.
http://www.lasc.us/RangingShotBarrelMakingFeature.htm
Hammer-forging was first used in making barrels in the late 1930s for German military weapons, and was in use for many years prior to civilian market introduction. Hammer forged barrels were introduced to the US markets by Sako in the 1960s.
Traditional barelmaking starts with annealed and stress relieved bar stock which is then deep hole drilled, reamed, stress relieved, sometimes honed, and then the rifling of the bore begins, either by cutting or by pulling a carbide plug through the bore to form the rifling.
Due to the large amounts of stress imposed on the barrel tubes, stress relieving would cause warping which would actually add handwork to the barrel production process, and industrial processes are designed to eliminate handwork from processes.They all may not stress relieve them after hammer forging but they should...