Commits

Takayuki KONDO  committed 85a2f21

support Cygwin environment

  • Participants
  • Parent commits b053b79

Comments (0)

Files changed (1)

File force-one-head.sh

 # -*- coding:sjis-unix -*-
 #
 # <repository>/.hg/hgrc ‚É’Ç‹L‚ľ‚Ä‚­‚ž‚ł‚˘
-# -----------------------------------------------------------
+# ----------------------
+# Linux ‚Ěę‡
+# ----------------------
 # [hooks]
 # pretxnchangegroup.forceonehead = .hg/force-one-head.sh
 # -----------------------------------------------------------
+# ----------------------
+# Windows(Cygwin) ‚Ěę‡
+# ----------------------
+# [hooks]
+# pretxnchangegroup.forceonehead = call .hg\force-one-head.bat
+# -----------------------------------------------------------
+# Cygwin ‚̊‹Ť‚Ěę‡APATHŠÂ‹Ť•Ď”‚É /usr/bin ‚đ’Ę‚ˇ‚Ć hg ‚Ş 
+# Cygwin ’ń‹Ÿ‚Ěhg ‚É‚Č‚čA‚¤‚Ü‚­ hooks ˆ—‚Ş“Žě‚ľ‚Ü‚š‚ń
+#
 export LANG=C 
-export PATH=/usr/local/bin:/usr/bin:/usr/sbin:/sbin:/bin:$PATH
 
-if [ $(hg heads --template "{branch}\n"|sort|uniq|wc -l) != $(hg heads --template "{branch}\n"|sort|wc -l) ]; then
+
+if [ $(hg heads --template "{branch}\n"|/usr/bin/sort|/usr/bin/uniq|/usr/bin/wc -l) != $(hg heads --template "{branch}\n"|/usr/bin/sort|/usr/bin/wc -l) ]; then
+    echo '============================================================'
     echo '[Œx] ƒ}ƒ‹ƒ`ƒvƒ‹ƒwƒbƒh‚É‚Č‚Á‚Ä‚˘‚Ü‚ˇ'
     echo '       hg pull ‚ľ‚Ä hg rebase ‚đŽŔs‚ľAƒ}[ƒW‚ľ‚Ä‚­‚ž‚ł‚˘'
     echo '       # hg push -f ‚͂‚Š‚Á‚Ă̓_ƒ'
+    echo '============================================================'
 
     exit 1
 fi