Extracting single file from remote hg repository

Scott Palmer swpalmer at gmail.com
Mon Aug 19 14:36:25 UTC 2019


You mention: "I have to assume that the remote repository is running without a
hosting server or with an unknown one. So abusing a web frontend for
this task is out of the question.”

But it must be a hosting server that follows the Mercurial server protocols.  Is it not standard to support ‘raw’ file access via the URL?
Like this:

<scheme>://<server>/project_path/path/to/file/raw/<HASH>

To get the raw file, identified by "path/to/file” at the given changeset hash, for the repo at “<scheme>://<server>/project_path”  ?  Are there Mercurial servers that don’t support this?


Scott

> On Aug 18, 2019, at 7:11 am, Gregor Mückl <GregorMueckl at gmx.de> wrote:
> 
> Hi!
> 
> I'm facing the following problem: I need to extract a single file from a
> remote repository in an automated process. I won't detail my higher
> level requirements here. Suffice to say that I have hit this problem
> with git and hg on several occasions in the past. In this iteration, it
> is a bit nastier than before:
> 
> - I have to assume that the remote repository is running without a
> hosting server or with an unknown one. So abusing a web frontend for
> this task is out of the question.
> 
> - Cloning the whole repository is out of the question, too. This can
> waste a lot of bandwidth, time and disk space on the client. All I need
> is a configuration file that is a few kB in size. The required bandwidth
> for that should be somehow proportional.
> 
> - No temporary files. Managing those properly is hard. I'd rather write
> a considerably more complex program that does everything in memory than
> a solution that might leak files.
> 
> - The solution has to work at least on Windows and Linux.
> 
> So in essence, what I am asking is probably the following: is there a hg
> client capable of assembling a file from a remote repository's tip while
> working entirely in memory? If not, what would it take to write one?
> 
> Gregor
> <pEpkey.asc>_______________________________________________
> Mercurial mailing list
> Mercurial at mercurial-scm.org
> https://www.mercurial-scm.org/mailman/listinfo/mercurial




More information about the Mercurial mailing list