Dick Greenhaus, 2 years ago! asked: is it a naval shanty.
Well, I'm not a buff, but yes, according to Stan Hugill, it is one of the two shanties that were sung on HMShips
Can't remember if I remember this from conversation with him or reading one of his books, but I do remember it, if you see what I mean.