How to list all remote repositories in Mercurial?
Asked Answered
P

2

7

I'm just looking for a Mercurial command that can list the available repositories in the remote parent repository. When I used subversion, this was simple, as in:

svn ls httpx://server/repos/002/trunk

svn ls httpx://server/repos/002/trunk/blort

svn ls httpx://server/repos/002/trunk/blort/fubar

And then I could use ``svn co'' to fetch as much or as little of some directory tree as I wished.

However, I can't find the analog to this in Mercurial. All the tutorials seem to expect you to know precisely the path to the remote repository and don't discuss anything about even some top level browsing of the remote repository.

Thanks.

Punak answered 20/8, 2011 at 21:34 Comment(1)
In your example there is also only one repo, httpx://server/repos, 002/ and deeper are paths inside of the repository. The difference between SVN and mercurial is that SVN allows to checkout subtrees of a tree, while mercurial always takes the full tree.Lodger
O
8

There is only 1 path to the repository.

With a DVCS you typically clone the repository as a whole. Then you can look at it all you want locally. That is why you have received those answers in the past.

Olivette answered 20/8, 2011 at 21:39 Comment(5)
As an alternative, there are Branches in Mercurial like in git.Resign
Mercurial has at least 3 ways to handle branching. Best to read up on it. Have you read hginit.comOlivette
But what if you have a repository on the order of several GB in size? Are you saying that I need to download that whole monster just to get a feel for the top level structure? I'm just looking for a non-recursive equivalent of ``svn ls'' that works in mercurial.Punak
Yes. You always download the entire history of the whole repo with a DVCS -- you always have all history. If your repo is several GB in size you should stop storing binaries or split it into multiple repositories using subrepos.Jaques
If you really really want to have these giant repos and then browse them, just set up a source browser web app on the machine where your hg repos are, and then you can look at them in your web browser. "hg serve" will even give you a basic version of this.Mammary
F
1

I dont know about a command but it is doable with a script

for repo in `curl $url/hgweb.cgi | \
    grep -v "atom" | \
    grep hgweb.cgi | \
    awk -F'>' '{ print $3}' | \
    awk -F'<' '{print $1}'`; do \
    echo $repo \
    done
Fructify answered 28/12, 2020 at 10:29 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.