1. Takayuki KONDO
  2. hghooks-and-scripts

Commits

Takayuki KONDO  committed 5a8a303

Added: force-one-head scripts

  • Participants
  • Branches default

Comments (0)

Files changed (2)

File force-one-head.bat

View file
+@echo off
+setlocal
+
+C:\cygwin\bin\sh.exe .hg/force-one-head.sh
+if not %ERRORLEVEL% == 0 (
+	echo *** force-one-head.sh failed. %ERRORLEVEL% ***
+	exit /b %ERRORLEVEL%
+)

File force-one-head.sh

View file
+#!/bin/bash
+# -*- coding:utf-8 -*-
+#
+# <repository>/.hg/hgrc に追記してください
+# -----------------------------------------------------------
+# [hooks]
+# pretxnchangegroup.forceonehead = .hg/force-one-head.sh
+# -----------------------------------------------------------
+
+if [ $(hg heads --template "{branch}\n"|sort|uniq|wc -l) != $(hg heads --template "{branch}\n"|sort|wc -l) ]; then
+    echo '[警告] マルチプルヘッドになっています'
+    echo '       hg pull して hg rebase を実行し、マージしてください'
+    echo '       # hg push -f はつかってはダメ'
+
+    exit 1
+fi