How to display current working copy version of an hg repository on a PHP page

后端 未结 1 791
别那么骄傲
别那么骄傲 2020-12-13 08:22

I use Mercurial for most of my projects and when I deploy a web site, I simply just do an hg clone on the production server and hg pull -u from the

相关标签:
1条回答
  • 2020-12-13 08:26

    You could use a post-update hook to put the information in a file. In the site's .hg/hgrc you'd put something like this:

    [hooks]
    post-update = hg id --rev > VERSION ; hg id --id >> VERSION
    

    then you can access that file from inside your php. You'll still need to make sure that the user running the hg pull -u trusts the hgrc file and that the VERSION file has permissions such that the webserver can read it.

    0 讨论(0)
提交回复
热议问题