changeset 25:314a97096d1f

Теперь только безпасный способ синхронизации репозиториев. Не пыпаемся мержить. Если число head равно 1, возвращаем изменения обратно. Добавил документацию.
author Oleksander Gavenko <gavenko_a@3g.ua>
date Sun, 02 Mar 2008 22:24:23 +0200
parents 4e0c7b4c7145
children 1629c70891cc
files hg/hgrep
diffstat 1 files changed, 19 insertions(+), 15 deletions(-) [+]
line wrap: on
line diff
--- a/hg/hgrep	Sun Mar 02 21:26:56 2008 +0200
+++ b/hg/hgrep	Sun Mar 02 22:24:23 2008 +0200
@@ -1,7 +1,17 @@
 #!/bin/sh
 # -*- coding: cp1251-unix -*-
 
-# XXX debug output.
+# Copyright (C) 2008 by Oleksandr Gavenko <gavenko_a@3g.ua>
+#      
+#       .
+
+# XXX mercurial    ,    .
+#            0.
+#    ,    tip - mercurial  
+#    :
+# abort: working dir not at a head rev - use "hg update" or merge with an explicit rev
+
+# XXX debug.
 # export HOME=E:\\home\\devel\\tmp\\1\\home
 
 LOG_FILE=hgrep.log
@@ -86,7 +96,7 @@
     dir=${dir##*/}
     echo $dir
 
-    #  HG_PULL_DIR  changeset.
+    #  HG_PULL_DIR  changeset     .
     if [ -d $HG_PUSH_DIR/$dir ] ; then
         if [ -d $HG_PULL_DIR/$dir ] ; then
             hg -R $HG_PULL_DIR/$dir pull $HG_PUSH_DIR/$dir >>$LOG_FILE
@@ -105,24 +115,18 @@
     #      HG_PUSH_DIR  CURR_DIR.
     HEAD_CNT=`hg -R $HG_PULL_DIR/$dir head | grep "changeset:" | wc -l - | sed 's/ *\([0-9]*\) -/\1/'`
     case $HEAD_CNT in
+        #     -  ""
+        #        ,
+        #     .
         1)
             hg -R $HG_PULL_DIR/$dir push $HG_PUSH_DIR/$dir >>$LOG_FILE
             hg -R $HG_PULL_DIR/$dir push ./$dir >>$LOG_FILE
             ;;
-        2)
-            if hg -R $HG_PULL_DIR/$dir merge >>$LOG_FILE ; then
-                hg -R $HG_PULL_DIR/$dir ci -m "Auto merge."
-            else
-                ERR_MSG="You must manually merge $dir proj.
-Go to $HG_PULL_DIR/$dir."
-                PrintErr
-                exit 1;
-            fi
-            ;;
+        #    ""    
+        #          .
         *)
-            ERR_MSG="Unsuporrted merge many branches."
-            PrintErr
-            exit 1;
+            echo "You must manually merge $dir proj. Go to $HG_PULL_DIR/$dir."
+            hg -R $HG_PUSH_DIR/$dir push -f ./$dir >>$LOG_FILE
             ;;
     esac
 done