A good question! There's a version in the James Aird Book (ABC, Jack Campin's website) from 1782, but that's not the version we play, in fact I only know it's there because I spotted it the other day when I was looking for something else, and arguably it's a Scottish version. The version we play is something like the one in Brian Peters' "Rattle and Roll" tune book. Also I think it may be in The Jamie Knowles "A Northern Lass".
There is some confusion (even between Mary and me) about the penultimate bar of the B music. This may be the difference between Jamie's and Brian's versions but as I'm at work and the books are at home I can't check immediately.
With a bit of luck Greg Stephens will be along shortly to make a more informed pronouncement about the tune's origins and history.