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 8128293
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 6, 20262026-06-06T07:49:52+00:00 2026-06-06T07:49:52+00:00

I need the equivalent of git post-receive hook in Mercurial so I can notify

  • 0

I need the equivalent of git post-receive hook in Mercurial so I can notify another service that a push has been done to the repository.

What I need in my hook is simple: changeset revision of the last changeset.

Of course I understand that the difference with git is that the ref won’t be named, and there can be multiple heads pushed to the repository. I might be OK with that.

What I don’t want for the moment, is the behavior of my current implementation using hg incoming hook: I have the revision of every pushed changeset.

Then, to sum up, what is hg best way to be notified of the last pushed commit to a repository ?

EDIT: The goal is to notify another service to pull from the repository because new code has arrived. But I don’t want the service to pull for every changeset in the push

  • 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-06-06T07:49:54+00:00Added an answer on June 6, 2026 at 7:49 am

    Basically, it sounds like you want to use the changegroup hook. It is like the incoming hook, but only fires once for bundles of changes. It provides you with the ID of the first new changeset in $HG_NODE though, I’m not sure if that suits you.

    See: http://www.selenic.com/mercurial/hgrc.5.html#hooks

    It is a bit unclear to me which changeset you mean exactly by the ‘last’ changeset. As changesets may be added to multiple heads at once, the last changeset could be on any branch, so it’s not very useful information for say, updating.

    If you want to identify which changesets were new since the last push, having the first changeset should suit you just as well if not better (as it allows you to identify new changesets without knowledge of the previous push).

    However if you really want to know the ID of the last changeset, you can invoke the following command from the hook: hg tip --template "{node}". See hg help tip for more information.

    If you provide some background on what you want to use this information for precisely, then I can give a more clear suggestion on how to best handle that.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Question: I need a equivalent of Microsoft Reporting Service, that works on Linux. Free
Can the launchApplcation call be usedv in a non-Cocoa app? I need the equivalent
I can easily do this in C#...but I need the equivalent in VB.Net. I
Desperately need a Javascript equivalent to polyval and polyfit functions that exist in Matlab.
I can do this in MS-Access (and it works) but need the equivalent in
I need an equivalent to C's pow() function that will work with NSDecimalNumbers. With
i need equivalent c# code VssSdkClientId VSS_SDK_SPEC startVssSdkClientEcho(const VssSdkXChar *host, const VssSdkPort port, NotifyFunc
I need C# equivalent to Java’s continue ? i have for (String b :
I'm not sure where this is handled. I need the equivalent of PHP's set_time_limit(seconds)
I need a Python equivalent of PHP's include function. I know of execfile(), but

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.