Add a method for getting all known branches from VCS

Summary: Add a method for hg and git to retrieve all known branches from VCS

Test Plan: make test

Reviewers: cramer

Reviewed By: cramer

Differential Revision: https://tails.corp.dropbox.com/D60991