Single file.. retrieve older version.

Harry Putnam reader at newsguy.com
Thu Apr 8 15:22:27 CDT 2010


Martin Geisler <mg at lazybytes.net> writes:

> When you do 'hg revert -r REVISION file', you update the content of file
> to match how it appeared in REVISION. You do not change the working copy
> parent revision (you didn't use 'hg update'), so 'hg status' will now
> report that the file is modified.

If I wanted the content of  -r REVISION file on stdout, is there a way
to do that?

I mean like you might do in cvs with:

  cvs update -p -r1.3 sandbox/path/file

Which will put the content of -r1.3 sandbox/path/file on stdout.

So a redirect:
   cvs update -p -r1.3 sandbox/path/file > ~/file

creates an exact copy of the contents of -r1.3 in ~/file and nothing
whatever is changed in the checked out module, hence no further action
required. 
   
What people have shown in this thread using `revert' appears to change
the repo in a way that needs to be un-changed or changed back.

I'd like to see how to acquire the content of the file from repo
revision 3 without any further to do.



More information about the Mercurial mailing list