/util/hg_hooks: d95af8a2bf44: Only trigger sync with the notific...

Daniel Atallah datallah at pidgin.im
Sat Jun 16 17:24:56 EDT 2012


Changeset: d95af8a2bf44a31065d8911fa5479c8de3e26b8e
Author:	 Daniel Atallah <datallah at pidgin.im>
Date:	 2012-06-16 17:24 -0400
Branch:	 default
URL: http://hg.pidgin.im/util/hg_hooks/rev/d95af8a2bf44

Description:

Only trigger sync with the notification repo if the current repo is in a hgweb accessible path

diffstat:

 notify_repo_sync.sh |  11 +++++++----
 1 files changed, 7 insertions(+), 4 deletions(-)

diffs (20 lines):

diff --git a/notify_repo_sync.sh b/notify_repo_sync.sh
--- a/notify_repo_sync.sh
+++ b/notify_repo_sync.sh
@@ -1,9 +1,12 @@
 #!/bin/bash
 
 REPO=$1
-#Strip off "/var/mercurial-server/repos"
-WEBROOT=`echo "$REPO" | sed -e "s/^\/srv\/mercurial-server\/repos\//\//"`
-NOTIFICATION_REPO=/srv/mercurial-server/notification-repo
 
-nohup env -i hg --config notify.webroot=$WEBROOT --config cia.webroot=$WEBROOT --cwd $NOTIFICATION_REPO pull $1 >> /tmp/notifypull.log 2>&1 &
+#Only trigger notification if it is repo that is accessible via hgweb
+if [[ $REPO == /var/mercurial-server/repos/* ]]; then
+	#Strip off "/var/mercurial-server/repos"
+	WEBROOT=`echo "$REPO" | sed -e "s/^\/srv\/mercurial-server\/repos\//\//"`
+	NOTIFICATION_REPO=/srv/mercurial-server/notification-repo
 
+
+fi



More information about the Commits mailing list