"The Topman and the Afterguard", also known as "The Soldier and the Sailor" is an English drinking song. There are several versions. The Hardtacker's version is similar to the drinking song "Drunk Last Night". It can be sung to a number of melodies. The Hardtackers sing it to the melody of "Pleasant and Delightful".
Mike Seeger recorded it with a similar melody (as "The Soldier and the Sailor") on Southern Banjo Sounds.
I learned it from The Hardtackers on their Don't Forget Your Old Shipmates CD.