#!/bin/sh # # hg-tag-project # # Called with the current directory at a Mercurial project, this # adds a tag at the given change with the value 'build--'. # It then pushes the tag to the parent repo. # # This is to be used as the final Jenkins build step where a # build-on-success tag is wanted. # usage() { echo "Usage: hg-tag-project " exit 1 } if [ $# -ne 2 ]; then usage fi branch=`hg branch` echo "hg pull -u" hg pull -u echo "hg tag -u 'Jenkins Build Manager ' -f -r $2 build-$branch-$1" hg tag -u "Jenkins Build Manager " -f -r $2 build-$branch-$1 echo "hg push -f" hg push -f exit 0