Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 4613776
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 22, 20262026-05-22T01:36:08+00:00 2026-05-22T01:36:08+00:00

I use Mercurial for most of my projects and when I deploy a web

  • 0

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 there. What I’d like to do is add a small snippet to my site’s footer which displays the current revision number (both decimal and hex) as well as perhaps the current branch. Stack Overflow and BitBucket both do a variation of what I’m looking for.

I briefly tried parsing the output of exec('hg summary'), but I ran into a couple permissions problems before wondering if there was any better way to do it. Is there a better way, or is exec my best option?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-22T01:36:09+00:00Added an answer on May 22, 2026 at 1:36 am

    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
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I'm starting to use Mercurial on my web server (in this case MediaTemple's Grid).
I use mercurial patches in the following cases:- When I need to pull from
I use mercurial for php projects and my .hgignore file is not working. It's
I'm using Mercurial for personal use and am conteplating it for some distributed projects
We would like to use mercurial for web development, but we can't (and don't
I'm trying to configure Mercurial for use with both a windows server (freeSSHd) and
I'd like to evaluate Mercurial for my working projects. But most of my projects
I've decided that I want to use Mercurial for a small, personal project. Most
I just switched to Mercurial from SVN. I've done some basic stuff (importing my
For one of the libraries I use, I'm trying to switch from a mercurial

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.