Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

List remote branches in Mercurial

Is there a way to list remote branches in Mercurial like there in Git?

git branch -r 

I want to list the branches on a remote machine (e.g. Bitbucket), so using:

hg branches -R `hg showconfig paths.default` --color false 

fails with abort: repository not local

like image 573
Raoul Avatar asked Nov 28 '10 12:11

Raoul


People also ask

How do I switch between branches in Mercurial?

Quickly switch to another branch or bookmarkIn the Status bar, click the Mercurial Branch widget to open the Branches popup. Select the branch or bookmark to which you want to switch and in the menu that opens, click Update.

What is remote branch name?

A remote branch only refers to a branch in a remote repository. A remote tracking branch is the branch in your local repository that tracks the remote branch.


1 Answers

The mercurial API allows it:

from mercurial import ui, hg, node  peer = hg.peer(ui.ui(), {}, 'http://hg.python.org/cpython') for name, rev in peer.branchmap().items():     print(name, node.short(rev[0])) 

The above snippet produces:

default aaa68dce117e legacy-trunk b77918288f7d 3.2 4787b9b2f860 3.0 4cd9f5e89061 3.1 5a6fa1b8767f 2.3 364638d6434d 2.2 61b0263d6881 2.1 e849d484029f 2.0 5fd74354d73b 2.7 260f3ad7af4b 2.6 f130ce67387d 2.5 b48e1b48e670 2.4 ceec209b26d4 
like image 117
gvalkov Avatar answered Nov 12 '22 19:11

gvalkov