Can I export a file from this commit in Mercurial?

Let's say I have a file main.cthat I encoded. I already made # 100, but unfortunately I found that I need to restore some functions that I encoded to commit # 50. I know that I can use the repository explorer to see the differences between the different versions in this file, but what I would like to see is the file itself, since it was included in commit # 50 (without all these + and - the file, as it was at that time).

Is it possible?

I would not want to commit to # 50 to get these functions and then go back to # 100.

thank

+3
source share
2 answers

hg cat . , hg up. ,

hg cat -rC F

C F.

+6

hg update -r 50 that_file
cp that_file /to/some/other/location/
hg update -r 100 ---> to get back the new file

  • 100
  • /to/some/other/location/at revision 50
+1

Source: https://habr.com/ru/post/1779295/


All Articles