Chris R
Chris R

Reputation: 17916

What is the mercurial equivalent of 'svn cat'?

I want to print the contents of a single file from a remote repository, at a specified revision. How can I do that? In svn, it'd be:

svn cat <path to remote file>

update

The main thing I want to avoid is cloning the entire repository; some of the ones I'm working with are quite large, and I just need project metadata from a single file within.

Upvotes: 4

Views: 476

Answers (2)

Wim Coenen
Wim Coenen

Reputation: 66733

You may be able to download the file content with wget or your favorite browser. For example, for bitbucket repositories the URL looks like this:

http://bitbucket.org/<user>/<project>/raw/<revision>/<filename>

For the hg serve web interface, the URL looks like this:

http://<host>:<port>/raw-file/<revision>/<filename>

Upvotes: 2

Lasse V. Karlsen
Lasse V. Karlsen

Reputation: 391396

There's two ways to do what you want:

  1. Clone the repository locally, and execute the appropriate hg cat -r REV FILE against it
  2. Use a web interface that gives access to the remote repository

If you don't have the web interface, then you need to clone.

Upvotes: 6

Related Questions