Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Mercurial: How to include version information in exports?

Tags:

mercurial

Sometimes, I need to provide a version of my code to other collaborators without giving them access to the history (everything inside .hg directory). I do this by cloning my repository, updating the clone to the required version and deleting the .hg directory.

Is there a way I can include some information in this export operation that can later tell me which version I had actually passed them? For example, say automatically including the hash in a file or something similar? What is the canonical way to achieve something like this in Mercurial?

like image 397
Ashwin Nanjappa Avatar asked Feb 22 '23 05:02

Ashwin Nanjappa


1 Answers

Recent versions of hg archive place a .hg_archival.txt into the exported directory, which contains the revision of the dump.

$ hg archive ../output
$ cat ../output/.hg_archival.txt
repo: ca6f47a3560d95bc168f5d348fd42779537ce007
node: e8da6559282f6d0963ee31870ce1f0dc7e138459
branch: default
latesttag: null
latesttagdistance: 4
like image 94
Rudi Avatar answered Feb 24 '23 20:02

Rudi