Search code examples
version-controlmercurialnotify

How can I monitor a specific file for changes in Mercurial?


I have set up a remote Mercurial (Hg) repository that holds a large Java project. I would like to monitor any changes done to the project's pom file and receive e-mails when changes were made to the pom.

I would like to exclude all other file changes from notifications as I am only interested in monitoring any possible changes in dependencies (hence the POM). Is there any Mercurial Extension or workaround using Jenkins to subscribe to the change history for one individual file inside a Mercurial repo?


Solution

  • The notify extension sends email on repo changes.

    The Change Context (look in section 6) gives you a way to iterate over the files in the changeset.

    Putting these two things together in a custom hook should be fairly straightforward. Look through the context and only send email if your special file is mentioned.