changeset 37:fa50b7df5672

Вывод на экран/в лог, когда hgrepsync удачно переносит изменения.
author Oleksander Gavenko <gavenko_a@3g.ua>
date Thu, 20 Mar 2008 23:17:27 +0200
parents 739e51bcf406
children 030532d92e9b
files hg/hgrepsync
diffstat 1 files changed, 18 insertions(+), 2 deletions(-) [+]
line wrap: on
line diff
--- a/hg/hgrepsync	Thu Mar 20 22:31:40 2008 +0200
+++ b/hg/hgrepsync	Thu Mar 20 23:17:27 2008 +0200
@@ -174,8 +174,24 @@
         #        ,
         #     .
         1)
-            hg -R $HG_PULL_DIR/$dir push $HG_PUSH_DIR/$dir >>$LOG_FILE 2>&1
-            hg -R $HG_PULL_DIR/$dir push ./$dir >>$LOG_FILE 2>&1
+            CHANGESET_CNT=`hg --quiet -R $HG_PULL_DIR/$dir out --template '{node}\n' $HG_PUSH_DIR/$dir | wc -l - | sed 's/ *\([0-9]*\) -/\1/'`
+            case $CHANGESET_CNT in
+                0) ;;
+                *)
+                    hg -R $HG_PULL_DIR/$dir push $HG_PUSH_DIR/$dir >>$LOG_FILE 2>&1
+                    MSG="Added new changesets to etalon rep."
+                    PrintLog INFO
+                    ;;
+            esac
+            CHANGESET_CNT=`hg --quiet -R $HG_PULL_DIR/$dir out --template '{node}\n' ./$dir | wc -l - | sed 's/ *\([0-9]*\) -/\1/'`
+            case $CHANGESET_CNT in
+                0) ;;
+                *)
+                    hg -R $HG_PULL_DIR/$dir push ./$dir >>$LOG_FILE 2>&1
+                    MSG="Added new changesets to intermediate rep."
+                    PrintLog INFO
+                    ;;
+            esac
             ;;
         #    ""    
         #          .