Takayuki KONDO avatar Takayuki KONDO committed 5013208

add hook set-hg-branch-name

Comments (0)

Files changed (2)

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%
+)

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
Tip: Filter by directory path e.g. /media app.js to search for public/media/app.js.
Tip: Use camelCasing e.g. ProjME to search for ProjectModifiedEvent.java.
Tip: Filter by extension type e.g. /repo .js to search for all .js files in the /repo directory.
Tip: Separate your search with spaces e.g. /ssh pom.xml to search for src/ssh/pom.xml.
Tip: Use ↑ and ↓ arrow keys to navigate and return to view the file.
Tip: You can also navigate files with Ctrl+j (next) and Ctrl+k (previous) and view the file with Ctrl+o.
Tip: You can also navigate files with Alt+j (next) and Alt+k (previous) and view the file with Alt+o.