Mercurial: Notification when only a file with a specif name changes

Viewed 75

I need email notification only if a file named FMHomeConfig.txt anywhere in my repo changes. I saw How can I monitor a specific file for changes in Mercurial? but I have not been able implement that solution.

I copied the script given as a solution in the above link to a file, fmhomeconfig.py. The only line I changed was:

file_match = ".base." #ui.config('monitor_files', 'file_match'). I changed ".base." to "FMHomeConfig.txt" as what I want is an email when anybody pushes a changeset containing any changes to a file of that name in any folder of my repo.

I saved fmhomeconfig.py to /opt/hgrepos/dev/testemail/.hg. My hgrc follows. This is an hgrc that produces an email when anybody pushes changes to the repo and works as long as I have

changegroup.notify = python:hgext.notify.hook

uncommented and the line following it commented, but does not send any emails in its present state even if I push changes to FMHomeConfig.txt.

[paths]
default = /opt/hgrepos/dev/testemail

[web]
baseurl = https://atphg.atpco.org
push_ssl = false
allow_read = *
allow_push = *

[extensions]
notify =

[hooks]
#changegroup.notify = python:hgext.notify.hook
changegroup.notify = .hg/fmhomeconfig.py
#pretxnchangegroup.forbid_2heads = python:./.hg/forbid_2head.py:hook
#changegroup.scm = python:scmhooks.callback
#pretxnchangegroup.scm = python:scmhooks.callback

[email]
from = #cm@atpco.net

[smtp]
host = mailhost

[notify]
sources = serve push unbundle
test = False
config =
template =
maxdiff = 300
strip = 4

[reposubs]
* = ntesterman@ATPCO.NET
0 Answers
Related