Latest 100 public
snipts » svn
showing 1-20 of 72 snipts for svn
-
∞ Htaccess Private Files (svn, cvs, sql, etc)
# Drupal's way of denying access to delicate server files <FilesMatch "\.(engine|inc|info|install|make|module|profile|test|po|sh|.*sql|theme|tpl(\.php)?|xtmpl|svn-base)$|^(code-style\.pl|Entries.*|Repository|Root|Tag|Template|all-wcprops|entries|format)$"> Order allow,deny </FilesMatch>
-
∞ svn ignore passwords
# on production servers its often a good idea not to store svn passwords. # heres a one-liner to do just that: echo "store-passwords=no" >> ~/.subversion/servers && rm -f ~/.subversion/auth/svn.simple/*
-
∞ grep find
# grep find excluding .svn directories # from http://wordaligned.org/articles/ignoring-svn-directories alias gf='find . -path "*/.svn" -prune -o -type f -print0 | xargs -0 grep -I -n'
-
∞ find exclude .svn
# exclude .svn folders with find find . -name "myfile*.*" \( -not -iname "*.svn*" \)
-
∞ Recursive revert all external items on svn WC
for i in $(svn status | grep ^Perf | cut -d\' -f 2); do svn revert -R $i ; done
-
∞ Subversion command to change repo
svn switch --relocation http://existing/url to http://new/url
-
∞ drupal files folder svn externals
# go to working copy cd ~/public_html/sites/default/ # take a backup tar zcvf files.tar.gz --exclude=.svn files # move drupal files folder out of trunk, and replace with externals, to keep trunk lightweight. svn mv http://svn/project/trunk/sites/default/files http://svn/project/assets/files -m "moved files folder out of trunk to assets" # delete files on working copy svn up # setup the external reference svn propset svn:externals 'files http://svn/project/assets/files' . # fetch external file svn up
-
∞ svn quickies
# recursive add $ svn status | grep "^\?" | awk '{print $2}' | xargs svn add #svn revert accidental rm $ svn revert --recursive example_folder #svn export a repository from one location to another $ svn export -r <release> PathOfSvnCheckOut NewPath # remove all .svn files and folders from a tree find . -name ".svn" -exec rm -rf {} \;
-
∞ Script que remove pastas .svn de uma árvore de diretórios
#!/bin/bash echo "Este script remove todos os .svn da pasta atual e subpastas." echo "Deseja continuar? (s/n)" read opt if [ $opt = "s" ]; then find . -name ".svn" -type d -exec rm -rf {} \; else echo "nada a fazer" fi
-
∞ Correct permissions for svn files in project
find -name .svn -exec sudo chmod 777 {} \; find $(find -name .svn) -type d -exec sudo chmod 777 {} \; find $(find -name .svn) ! -type d -exec sudo chmod 664 {} \;
-
∞ install svn on shared host
#Install subversion on a shared host curl -O http://subversion.tigris.org/downloads/subversion-1.6.9.tar.gz curl -O http://subversion.tigris.org/downloads/subversion-deps-1.6.9.tar.gz curl -O http://www.openssl.org/source/openssl-0.9.8l.tar.gz tar zxvf openssl-0.9.8l.tar.gz tar zxvf subversion-1.6.9.tar.gz tar zxvf subversion-deps-1.6.9.tar.gz cd openssl-0.9.8l/ ./config shared --prefix=$HOME/installs && make clean && make && make install cd ../ export CFLAGS="-O2 -g -I$HOME/installs/include" export LDFLAGS="-L$HOME/installs/lib" export CPP="gcc -E -I$HOME/installs/include" cd subversion-1.6.9/neon/ ./configure --with-ssl=openssl --prefix=$HOME/installs cd ../ ./configure --with-ssl --prefix=$HOME/installs --with-neon=$HOME/installs/bin/neon-config make clean && make && make install echo 'store-plaintext-passwords=no' >> ~/.subversion/servers
-
∞ Copy all .svn directories recursively to /tmp/svn with their dir structure
find -name .svn -print | xargs -n1 -i cp -R --parents {} /tmp/svn -
∞ clean local copy from SVN symfony project
1 create batch_local.txt file in project folder with this content for DIR in `find -name sql -type d`; do svn propset svn:ignore '*' $DIR/; done; for DIR in `find -name log -type d`; do svn propset svn:ignore '*' $DIR/; done; for DIR in `find -name cache -type d`; do svn propset svn:ignore '*' $DIR/; done; for DIR in `find -name base -type d`; do svn propset svn:ignore '*' $DIR/; done; for DIR in `find -name om -type d`; do svn propset svn:ignore '*' $DIR/; done; for DIR in `find -name map -type d`; do svn propset svn:ignore '*' $DIR/; done; svn commit -m 'change svn properties' svn status 2 $chmod +x batch_local.txt 3 $./batch_local.txt
-
∞ clean copy of symfony project for trac by using batch command
1 create batch_trac.txt in project folder with this content mv config/databases.yml config/databases.yml.sample; mv config/ProjectConfiguration.class.php config/ProjectConfiguration.class.php.sample; rm -rf cache/* log/*; find -name *schema.sql -exec rm -rf {} \; for DIR in `find -name base -type d`; do rm -rf $DIR/*;done; for DIR in `find -name map -type d`; do rm -rf $DIR/*;done; for DIR in `find -name om -type d`; do rm -rf $DIR/*;done; echo Clean project sucessfully! please do not forget delete all unnecessary file in project folder, For Example: *.txt for batching 2 $chmod +x batch_trac.txt 3 $./batch_trac.txt 4 you can import these code in trac system
-
∞ remove .svn folders
find . -name ".svn" -type d -exec rm -rf {} \;
-
∞ outdated drupal module with svn
## In a nutshell, how to update a module from Drupal contrib, ## on a production site that is under revision control (subversion). # If you turn on a module (that just happens to already be # present in the list on admin/build/modules), then you MUST # 1) go to the update status page # 2) find out if the module you just turned on is up to date # 3) if it is, fine (your done! stop here), # 4) if there are updates... then go to the drupal.org site first # to see if there are any "gotchas" for the upgrade. As you'll # be turning the module on for the first time on a new site, # then you shouldnt have to worry too much. # 5) To run the updates: login via ssh ssh username@server.com # 6) go to the right folder and execute drush update cd domains/example.com/public_html/sites/all/modules drush --uri=example.com update modulename # 7) confirm that the update was successful on the site # 8) then check in the code svn commit -u username -m "updated modulename to the latest version"
-
∞ svn:ignore
svn propset svn:ignore dirname . # If you have multiple things to ignore, separate by newlines in the property value. In that case it's easier to edit the property value using an external editor: -
∞ protect svn/cvs in apache conf
# Protect revision controlled web projects. This version is # for Apache's global configuration (conf) file. Protection # can also be done if you dont have access to Apache conf, # in any directorie's .htaccess file, in which case, Apache # conf must aleady be configured to use htaccess. <DirectoryMatch "^/.*/(\.svn|CVS)/"> Order deny,allow Deny from all </DirectoryMatch>
-
∞ svn bash shortcuts
alias .s='svn stat' alias .c='svn ci -m' alias .u='svn up' alias .a='svn stat | grep "^\?" | awk "{print \$2}" | xargs svn add' alias .d='svn stat | grep "^\!" | awk "{print \$2}" | xargs svn delete'
-
∞ divide and conquer svn repo
# The following structure exists: # # originalrepository/ # project_name/ # trunk/ # branches/ # tags/ # # I want to move it to its *own* repository and give the following structure: # # newrepositoryname/ # trunk/ # branches/ # tags/ # export LOCAL='file:/' export SVN_DIR='/home/bluespark/svn' export SVN_OLD_REPO='originalrepository' export SVN_PROJ='project_name' export SVN_REPO='newrepositoryname' cd $SVN_DIR ## Create dumps mkdir $SVN_DIR/dumps svnadmin dump $SVN_OLD_REPO > dumps/$SVN_OLD_REPO.dump ## Filter the specific project_name out of the dump svndumpfilter include $SVN_PROJ \ --drop-empty-revs \ --preserve-revprops \ --renumber-revs \ < dumps/$SVN_OLD_REPO.dump \ > dumps/$SVN_PROJ.dump ## Create the new repository... ## NOTE: You may need to do this step in the cpanel!! ## Here is how to do it on the comand line: # svnadmin create $SVN_DIR/$SVN_REPO ## Load the new repository with the contents of the ## filtered dump file. svnadmin load $SVN_REPO < dumps/$SVN_PROJ.dump ## Move the contens of the project_name to the repo root. svn mv $LOCAL/$SVN_DIR/$SVN_REPO/$SVN_PROJ/branches \ $LOCAL/$SVN_DIR/$SVN_REPO/$SVN_PROJ/tags \ $LOCAL/$SVN_DIR/$SVN_REPO/$SVN_PROJ/trunk \ $LOCAL/$SVN_DIR/$SVN_REPO/ \ -m "moved $SVN_PROJ contents to root" ## Delete the old (empty) project directory. ## Note: you need to make sure the directory ## is really empty before deleting! svn del $SVN_DIR/$SVN_REPO/$SVN_PROJ -m "removed old project directory"


