Would be simpler and clearer to inline into `getMercurialRevision`, obviating need for `Optional`. (I try to avoid using Guava since there have been so many compatibility nightmares.)