views:

123

answers:

4

How do I get a non-versioned copy of an older version of a file from a mercurial repository?

Edit: I have changed somefile.png (binary file) in my local copy. I am looking for a command which will allow me to get an earlier version of somefile.png so that I can compare it with my modified copy (using an image viewer) before I commit changes. How can I do that?

A: 

I'm not sure I understand the question. You you could just copy it somewhere else using the normal file copy tools of your operating system.

helium
Please ask questions as comments to the original question. This is not a real answer. Thanks :)
NicDumZ
You need at least 50 Reputation points to leave comments. As I'm new to this site I don't have them yet, so I couldn't. Thanks for the down-vote anyway.
helium
+1  A: 

If you mean: what is the equivalent of svn export?, that would be:

hg archive ..\project.export

See also this TipsAndTrick section

Make a clean copy of a source tree, like CVS export

hg clone source export
rm -rf export/.hg

or using the archive command

cd source
hg archive ../export

The same thing, but for a tagged release:

hg clone --noupdate source export-tagged
cd export-tagged
hg update mytag
rm -rf .hg

or using the archive command

cd source
hg archive -r mytag ../export-tagged
VonC
+4  A: 

The command you are looking for is cat

hg cat [OPTION]... FILE...

output the current or given revision of files

hg cat -o outputfile.png -r revision somefile.png

You can then compare somefile.png with outputfile.png

David Sykes
A: 

There is an hgtip tip that might get you most of the way there...Merging binary files.

While it specifically talks about merging, the diff stuff should be generic dnough to do it outside a merge...

RyanWilcox