#!/bin/sh

# Commit hook. Helps update bookmark.
# Put this file in your path.
#
# Edit file .hg/hgrc
#
# [hooks]
# commit = commithook

DEVELOP_BRANCH="develop"
RELEASE_BRANCH="release"
CURRENT_BRANCH=$(hg branch)

if [ $CURRENT_BRANCH = $DEVELOP_BRANCH ];
then
  hg bookmark -f master;
fi

if [ $CURRENT_BRANCH = $RELEASE_BRANCH ];
then
  hg bookmark -f release;
fi