mirror of
https://github.com/NixOS/nix.git
synced 2025-11-26 04:00:59 +01:00
Fixed a bug in the auto-deleted-checkout part of the commit bash script, Had to use a hack to get bash to support 2D arrays....
This commit is contained in:
parent
255bf5f04b
commit
fd2b8271e4
1 changed files with 24 additions and 7 deletions
|
|
@ -5,16 +5,22 @@
|
|||
|
||||
debug=""; #set to "" for no debugging, set to "echo " to debug the commands
|
||||
|
||||
if [ "$#" != 5 ] ; then
|
||||
if [ "$#" != 5 ] || [ "$#" != 6 ] ; then
|
||||
echo "Incorrect number of arguments"
|
||||
exit 1;
|
||||
fi
|
||||
|
||||
if [ "$deletesvn" != "" ] && [ "$deletesvn" != "1" ]; then
|
||||
echo "The last argument (DELETE svn folders) must be either empty (recommended) or 1"
|
||||
exit 1;
|
||||
fi
|
||||
|
||||
svnbin=$1
|
||||
subversionedpaths=( $2 ) #arrays
|
||||
subversionedpathsCommitBools=( $3 )
|
||||
nonversionedpaths=( $4 )
|
||||
checkouts=( $5 )
|
||||
deletesvn=$6 #this flag can be set to 1 to DELETE all .svn folders and NOT commit
|
||||
|
||||
#echo svnbin: $svnbin
|
||||
#echo subversionedpaths: ${subversionedpaths[@]}
|
||||
|
|
@ -45,6 +51,10 @@ function subversionSingleStateDir {
|
|||
do
|
||||
if [ "$subitem" = ".svn" ]; then
|
||||
allsubitems=( $(svn -N stat | sed -n '/^?/p' | sed 's/? //' | tr -d "\12") ) #there are subfiles, and theyre already versioned
|
||||
|
||||
if [ "$deletesvn" = "1" ]; then
|
||||
rm -rf .svn/
|
||||
fi
|
||||
fi
|
||||
done
|
||||
|
||||
|
|
@ -96,11 +106,15 @@ function subversionSingleStateDir {
|
|||
for item in ${subitems[@]}
|
||||
do
|
||||
if test -d $item; then #add or go recursive subitems
|
||||
if [ "$deletesvn" != "1" ]; then
|
||||
$debug svn -N add $item #NON recursively add the dir
|
||||
fi
|
||||
subversionSingleStateDir $item
|
||||
else
|
||||
if [ "$deletesvn" != "1" ]; then
|
||||
$debug svn add $item
|
||||
fi
|
||||
fi
|
||||
done
|
||||
|
||||
}
|
||||
|
|
@ -128,9 +142,10 @@ do
|
|||
let "i+=1"
|
||||
done
|
||||
|
||||
#echo $checkoutcommand;
|
||||
if [ "$deletesvn" != "1" ]; then
|
||||
$debug $checkoutcommand;
|
||||
fi
|
||||
fi
|
||||
|
||||
if [ "${subversionedpathsCommitBools[$i]}" = "true" ]; then #Check if we need to commit this folder
|
||||
|
||||
|
|
@ -138,9 +153,11 @@ do
|
|||
|
||||
subversionSingleStateDir $path;
|
||||
|
||||
cd $path #now that everything is added we can commit
|
||||
cd $path #now that everything is added we go back to the 'root' path and commit
|
||||
if [ "$deletesvn" != "1" ]; then
|
||||
$debug svn -m "" commit;
|
||||
fi
|
||||
fi
|
||||
|
||||
cd - &> /dev/null;
|
||||
fi
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue