changeset 574:15b39ce1378b

Take proper name for config parameter.
author Oleksandr Gavenko <gavenkoa@gmail.com>
date Mon, 12 May 2014 00:35:53 +0300
parents d8030b06fd51
children 4caff13871e8
files hg/hgsyncee hg/hgsyncee.1 hg/hgsyncrc.5
diffstat 3 files changed, 27 insertions(+), 27 deletions(-) [+]
line wrap: on
line diff
--- a/hg/hgsyncee	Thu May 08 22:48:32 2014 +0300
+++ b/hg/hgsyncee	Mon May 12 00:35:53 2014 +0300
@@ -94,12 +94,12 @@
         MSG="MASTER_DIR from $CFG point for non existing dir."
         return 1;
     fi
-    if [ x$EXTERNAL_DIR = x ] ; then
-        MSG="EXTERNAL_DIR not set in $CFG"
+    if [ x$MERGE_DIR = x ]; then
+        MSG="MERGE_DIR not set in $CFG"
         return 1;
-        if [ -d $EXTERNAL_DIR ] ; then :
+        if [ -d $MERGE_DIR ]; then :
         else
-            MSG="EXTERNAL_DIR from $CFG point for non existing dir."
+            MSG="MERGE_DIR from $CFG point for non existing dir."
             return 1;
         fi
     fi
@@ -151,17 +151,17 @@
     exit 1;
 fi
 
-if [ -d "$EXTERNAL_DIR" ] || mkdir "$EXTERNAL_DIR"; then
+if [ -d "$MERGE_DIR" ] || mkdir "$MERGE_DIR"; then
     :
 else
-    MSG="Can not create $EXTERNAL_DIR."
+    MSG="Can not create $MERGE_DIR."
     PrintLog ERROR
     exit 1;
 fi
 
 MSG="master dir: $MASTER_DIR"
 PrintLog INFO
-MSG="external dir: $EXTERNAL_DIR"
+MSG="external dir: $MERGE_DIR"
 PrintLog INFO
 
 echo
@@ -174,52 +174,52 @@
     PrintLog PROCESSING
 
     if [ -d $MASTER_DIR/$dir/.hg ]; then
-        if [ -d $EXTERNAL_DIR/$dir/.hg ] ; then
-            if CheckRepCompatibility $EXTERNAL_DIR/$dir $MASTER_DIR/$dir; then :
+        if [ -d $MERGE_DIR/$dir/.hg ]; then
+            if CheckRepCompatibility $MERGE_DIR/$dir $MASTER_DIR/$dir; then :
             else
-                MSG="'$EXTERNAL_DIR/$dir' and '$MASTER_DIR/$dir' is not compatable."
+                MSG="'$MERGE_DIR/$dir' and '$MASTER_DIR/$dir' is not compatable."
                 PrintLog ERROR
                 exit 1;
             fi
-            hg -R $EXTERNAL_DIR/$dir pull $MASTER_DIR/$dir >>$LOG_FILE 2>&1
+            hg -R $MERGE_DIR/$dir pull $MASTER_DIR/$dir >>$LOG_FILE 2>&1
         else
-            hg clone $MASTER_DIR/$dir $EXTERNAL_DIR/$dir >>$LOG_FILE 2>&1
+            hg clone $MASTER_DIR/$dir $MERGE_DIR/$dir >>$LOG_FILE 2>&1
         fi
-        if CheckRepCompatibility $EXTERNAL_DIR/$dir ./$dir; then :
+        if CheckRepCompatibility $MERGE_DIR/$dir ./$dir; then :
         else
             MSG="'$dir' and master is not compatable."
             PrintLog ERROR
             exit 1;
         fi
-        hg -R $EXTERNAL_DIR/$dir pull ./$dir >>$LOG_FILE 2>&1
+        hg -R $MERGE_DIR/$dir pull ./$dir >>$LOG_FILE 2>&1
     else
         MSG="'$dir' skiped. It is absent in master repo set."
         PrintLog INFO
         continue
     fi
 
-    HEAD_CNT=`hg -R $EXTERNAL_DIR/$dir head | grep "changeset:" | wc -l`
+    HEAD_CNT=`hg -R $MERGE_DIR/$dir head | grep "changeset:" | wc -l`
     case $HEAD_CNT in
         # Если нет необходимости мержить - изменения "правильные"
         # и должны быть возвращены как в промежуточный репозиторий,
         # так и в эталонный репозиторий.
         1)
-            CHANGESET_CNT=`hg --config defaults.outgoing="" --quiet -R $EXTERNAL_DIR/$dir out \
+            CHANGESET_CNT=`hg --config defaults.outgoing="" --quiet -R $MERGE_DIR/$dir out \
                 --template '{node}\n' $MASTER_DIR/$dir | wc -l`
             case $CHANGESET_CNT in
                 0) ;;
                 *)
-                    hg -R $EXTERNAL_DIR/$dir push $MASTER_DIR/$dir >>$LOG_FILE 2>&1
+                    hg -R $MERGE_DIR/$dir push $MASTER_DIR/$dir >>$LOG_FILE 2>&1
                     MSG="==> master"
                     PrintLog ADDED
                     ;;
             esac
-            CHANGESET_CNT=`hg --config defaults.outgoing="" --quiet -R $EXTERNAL_DIR/$dir out \
+            CHANGESET_CNT=`hg --config defaults.outgoing="" --quiet -R $MERGE_DIR/$dir out \
                 --template '{node}\n' ./$dir | wc -l`
             case $CHANGESET_CNT in
                 0) ;;
                 *)
-                    hg -R $EXTERNAL_DIR/$dir push ./$dir >>$LOG_FILE 2>&1
+                    hg -R $MERGE_DIR/$dir push ./$dir >>$LOG_FILE 2>&1
                     MSG="==> work"
                     PrintLog ADDED
                     ;;
@@ -230,7 +230,7 @@
         *)
             MSG="You must manually merge '$dir' proj and repeat run $UTIL_NAME."
             PrintLog WARNING
-            MSG="Go to $EXTERNAL_DIR/$dir dir."
+            MSG="Go to $MERGE_DIR/$dir dir."
             PrintLog WARNING
             hg -R $MASTER_DIR/$dir push -f ./$dir >>$LOG_FILE 2>&1
             ;;
--- a/hg/hgsyncee.1	Thu May 08 22:48:32 2014 +0300
+++ b/hg/hgsyncee.1	Mon May 12 00:35:53 2014 +0300
@@ -18,7 +18,7 @@
 Just cd to dir with repos, run hgsyncew.
 
 May happen that you must go to merge dir (pointed by
-.IR $EXTERNAL_DIR/$proj )
+.IR $MERGE_DIR/$proj )
 to merge changes manually and rerun
 .BR hgsyncee .
 
@@ -28,7 +28,7 @@
 .BR hgsyncrc(5) .
 
 You can not use HTTP protocol in
-.IR EXTERNAL_DIR
+.IR MERGE_DIR
 and
 .IR MASTER_DIR
 for
--- a/hg/hgsyncrc.5	Thu May 08 22:48:32 2014 +0300
+++ b/hg/hgsyncrc.5	Mon May 12 00:35:53 2014 +0300
@@ -8,23 +8,23 @@
 hgsyncrc \- configuration file for hgsync utilities
 \" .SH SYNOPSIS
 .SH DESCRIPTION
-File contain two parameters MASTER_DIR and EXTERNAL_DIR.
+File contain two parameters MASTER_DIR and MERGE_DIR.
 \" .SH OPTIONS
 .SH EXAMPLES
 Example of hgsyncrc file
 .PP
 .EX
   # this is comment
-  MASTER_DIR=/srv/hg-general-repo
-  EXTERNAL_DIR=/home/user/devel/hg-pull-repo
+  MASTER_DIR=/srv/hg
+  MERGE_DIR=/home/user/devel/hg-merge
 .EE
 .PP
 Under Windows (with MSYS or Cygwin installed) use config like:
 .PP
 .EX
   # this is comment
-  MASTER_DIR=c:/srv/hg-push-repo
-  EXTERNAL_DIR=c:/home/devel/hg-pull-repo
+  MASTER_DIR=c:/srv/hg
+  MERGE_DIR=c:/home/devel/hg-merge
 .EE
 .PP
 .SH FILES