1. Miki Tebeka
  2. pythonwise

Commits

Miki Tebeka  committed a4d22f2

close branch in hg

  • Participants
  • Parent commits 11f4017
  • Branches default

Comments (0)

Files changed (1)

File hg-close

View file
  • Ignore whitespace
+#!/bin/bash
+# Close a branch in mercurial
+
+case $1 in
+    -h | --help ) echo "usage: $(basename $0) BRANCH_TO_CLOSE [COMMENT]"; exit;;
+esac
+
+if [ $# -lt 1 ] || [ $# -gt 2 ]; then
+    echo "error: wrong number of arguments" 1>&2
+    exit 1
+fi
+
+
+comment=${2-Closing $1}
+
+set -e
+current=$(hg branch)
+hg co -q -C $1
+hg ci --close-branch -m "${comment}"
+hg co -q -C $current