Extracting one element

Simon King simon at simonking.org.uk
Thu Oct 27 08:43:57 UTC 2016


On Thu, Oct 27, 2016 at 9:11 AM,  <tamghar at astek.fr> wrote:
> Hi,
>
> I w'd like to know if there is a way to extract one element from Mercurial
> base.
> hg update -C <rev>  allows extracting all elements of the revision <rev>.
>

Does "hg cat" do what you want? For example:

    hg cat -r <rev> -o <outputfilename> <path/to/file>

    https://www.mercurial-scm.org/repo/hg/help/cat

Alternatively, "hg revert" can revert a file to a specific revision:

    hg revert -r <rev> <path/to/file>

    https://www.mercurial-scm.org/repo/hg/help/revert

Hope that helps,

Simon



More information about the Mercurial mailing list