Commits

Takayuki KONDO  committed 5013208

add hook set-hg-branch-name

  • Participants
  • Parent commits 4daba10

Comments (0)

Files changed (2)

File set-hg-branch-name.bat

+@echo off
+setlocal
+
+C:\cygwin\bin\sh.exe .hg/set-hg-branch-name.sh
+if not %ERRORLEVEL% == 0 (
+	echo *** set-hg-branch-name.sh failed. %ERRORLEVEL% ***
+	exit /b %ERRORLEVEL%
+)

File set-hg-branch-name.sh

+#!/bin/bash
+# -*- coding:sjis-unix -*-
+#
+# <repository>/.hg/hgrc ‚É ‰ş‹L hook ‚đÝ’č‚ľ‚Ä‚­‚ž‚ł‚˘
+# ----------------------
+# Windows(Cygwin) ‚Ěę‡
+# ----------------------
+# [hooks]
+# pretxnchangegroup.sethgbranchname = call .hg\set-hg-branch-name.bat
+# -----------------------------------------------------------
+# Cygwin ‚̊‹Ť‚Ěę‡APATHŠÂ‹Ť•Ď”‚É /usr/bin ‚đ’Ę‚ˇ‚Ć hg ‚Ş 
+# Cygwin ’ń‹Ÿ‚Ěhg ‚É‚Č‚čA‚¤‚Ü‚­ hooks ˆ—‚Ş“Žě‚ľ‚Ü‚š‚ń
+#
+export LANG=C 
+
+export HG_BRANCH_NAME=""
+for branch in `hg log -r "$HG_NODE:tip" --template "{branch} \n" | /usr/bin/sort | /usr/bin/uniq`; do
+    export HG_BRANCH_NAME="$HG_BRANCH_NAME $branch"
+done
+echo 'push ‚ł‚ę‚˝ ƒuƒ‰ƒ“ƒ`–źˆę—— :' $HG_BRANCH_NAME
+
+exit 0