I hand filed a swamp into a 1 1/8" straight 42" x .54 GRRW barrel when I was younger. Have seen a lot of originals, and the flats are not even in width nor smooth in profile, so did it by eyeball like Mike B above. I'm not a machinist and have no tools, so approached it as a farm boy. Filed a few notches to depth I wanted with chain saw file. Used an old 49 cabinet rasp to rough out going across the flats - much easier on the body, then coarse and fine rasps lengthwise to clean up only the flats that show - like the old ones. Took parts of two days, but was still in good football shape. It shoots real fine. The metal stresses comment is interesting, but fortunately I didn't know about such things.
Also picked up a poorly built pistol with a straight, high quality barrel, and hand filed the flats on the top or visible flats only - as bottom flats already inlet. Then put slight "swamp" in the wood to finish the appearance. Looks and feels like a swamped barrel, and shoots very well.
Have filed tapers and/or swamps in quite a few pistol barrels. Would order a 42" rifle barrel with fast pistol twist, then cut, shape and breech sections for projects. Short barreled pistols are usually for show, and have shot fine from my experience.
Back in the days before swamped barrels, we did lots of shimming, tapering bolster, and "swamping the forestock" to get the architecture closer. Today's variety of barrels sure is nice, though some "standard patterns" are not real close to the profile of old barrels. Bob