/util/hg_hooks: 3383c1961a7e: Strip off any trailing slashes so ...

Daniel Atallah datallah at pidgin.im
Fri Jul 13 00:38:35 EDT 2012


Changeset: 3383c1961a7e01876a3bddfbf4754661d1bfb626
Author:	 Daniel Atallah <datallah at pidgin.im>
Date:	 2012-07-13 00:38 -0400
Branch:	 default
URL: http://hg.pidgin.im/util/hg_hooks/rev/3383c1961a7e

Description:

Strip off any trailing slashes so that the URL in the notifications is correct

diffstat:

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

diffs (14 lines):

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



More information about the Commits mailing list