The song is "The Jolly Beggar", Child #279, but not all versions have that chorus. The earliest that does, and has a tune, is that 'The Scots Musical Museum', #266. There are about 30 texts with tunes and about a half-dozen more tunes in Bronson's 'The Traditional Tunes of the Child Ballads'.