It is possible to retrieve the local branches from a local repository with hg branches
. Is it possible to do this also with a remote repository programatically?
views:
206answers:
2Unfortunately, there is no way to determine the branches in a remote Mercurial repository without pulling in the repository. You can avoid saving data on disk, by getting the information you desire by using hg incoming
, but that command works by pulling the entire repository data anyway--likely not what you want. Unfortunately, your best bet is probably going to be simply to perform a check-out, and then query your now-local repository.
If that's truly unacceptable, you have two additional solutions: you can screen-scape the Bitbucket page for your repository, using a tool like BeautifulSoup or lxml, or you can wait until Bitbucket releases their API, which will likely provide this functionality.
Use bitbucket API
curl http://api.bitbucket.org/1.0/repositories/:username/:repo_slug/branches/
Read more here: http://api.bitbucket.org/1.0/doc/repositories/