]> gitweb.fluxo.info Git - simplepkg.git/commitdiff
fix on svn_copy
authorrhatto <rhatto@04377dda-e619-0410-9926-eae83683ac58>
Thu, 11 Dec 2008 16:14:14 +0000 (16:14 +0000)
committerrhatto <rhatto@04377dda-e619-0410-9926-eae83683ac58>
Thu, 11 Dec 2008 16:14:14 +0000 (16:14 +0000)
git-svn-id: svn+slack://slack.fluxo.info/var/svn/simplepkg@647 04377dda-e619-0410-9926-eae83683ac58

trunk/lib/common.sh

index 8539abd11d53b7a3fd025f4f47bd4f1d01d22703..89e4e25f90415572416959e840855705d0f931a3 100644 (file)
@@ -669,9 +669,9 @@ function svn_del {
 
 function svn_copy {
 
+  # svn add file
   # usage: svn_copy <orig> <dest>
 
-  # svn add file
   [ $# -ne 2 ] && handle_error $ERROR_PAR_NUMBER
 
   if [ -e "$1" ]; then
@@ -687,7 +687,11 @@ function svn_copy {
     fi
 
     # copy file
-    cp $orig/$file $dest
+    if [ "$(cd $(dirname $orig) ; pwd)" != "$(cd $(dirname $dest) ; pwd)" ]; then
+      cp $orig/$file $dest
+    fi
+
+    # add file to the revision system
     if [ -d "`dirname $dest`/.svn" ]; then
       chown_svn $dest && chgrp_svn $dest
       ( cd `dirname $dest` && svn_add `basename $dest` )