you are in: codestackercodes [RSS] → tag: subversion [RSS]

ignored rails' files in subversion Delicious Email

show/hide lines
   1  svn propset svn:ignore '*' log
   2  svn propset svn:ignore '*' tmp/cache
   3  svn propset svn:ignore '*' tmp/pids
   4  svn propset svn:ignore '*' tmp/sessions
   5  svn propset svn:ignore '*' tmp/sockets
   6  svn commit -m "Set various ignores"
created by leozera — 29 November 2008 — get a short url — tags: rails subversion svn embed

ignore all files from a folder Delicious Email

ignores all files in ‘photo’ folder

show/hide lines
   1  svn propset svn:ignore “*” public/photo/
created by leozera — 21 November 2008 — get a short url — tags: subversion svn embed

reverting a file with subversion Delicious Email

show/hide lines
   1  svn up -r PREV yourfile
created by leozera — 18 November 2008 — get a short url — tags: subversion svn embed

remove SVN control Delicious Email

removes all .svn directories recursively

show/hide lines
   1  find . -name .svn -exec rm -rf {} \; 
   2  
   3  find . -name .svn -print0 | xargs -0 rm -rf
created by leozera — 29 September 2008 — get a short url — tags: shell subversion svn embed

bash script to create rails and subversion structure Delicious Email

show/hide lines
   1  #!/bin/bash
   2  
   3  echo "########################################"
   4  echo ""
   5  echo ""
   6  echo "This bash script creates a new rails project and do the initial svn import with ignoring/deleting files from subversion"
   7  echo ""
   8  echo ""
   9  echo "#######################################"
  10  
  11  echo "Enter svn username: "
  12  read username
  13  echo "Enter the svn url: "
  14  read svn_url
  15  
  16  echo "Enter Rails Application Path:(eg: /home/leonardofaria/Sites/): "
  17  read app_path
  18  echo "Enter Application Name: "
  19  read app_name
  20  
  21  echo "######################################"
  22  echo "Please verify the following variables: "
  23  echo "Svn Username: ${username}"
  24  echo "Svn URL: ${svn_url}"
  25  echo "Application Path: ${app_path}"
  26  echo "Application name: ${app_name}"
  27  
  28  echo "Proceed (y/n)"
  29  read proceed
  30  
  31  if [ ${proceed} = n ] || [ ${proceed} = N ]
  32      then
  33      echo "Terminating..."
  34      exit 0
  35  elif [ ${proceed} = y ] || [ ${proceed} = Y ]
  36      then
  37      app_root="${app_path}/${app_name}"
  38      echo "Generating rails project: (${app_root})"
  39      rails ${app_root}
  40  
  41      echo "SVNinitial import: "
  42      svn import ${app_root} ${svn_url} -m "Initial Import" --username $username
  43  
  44      rm -rf ${app_root}
  45     
  46      echo "Checking out from svn: "
  47  
  48      svn checkout ${svn_url} ${app_root}
  49      cd ${app_root}
  50      echo "Removing all log files from SVN"
  51      svn remove log/*
  52      echo "commiting..."
  53      svn commit -m 'removing all log files from subversion'
  54      echo "Ignoring all log files under log dir"
  55      svn propset svn:ignore "*.log" log/
  56      echo "Updating and commiting..."
  57      svn update log/
  58      svn commit -m 'Ignoring all files in /log/ ending in .log'
  59  
  60      echo "Ignoring cache, sessions, sockets inside tmp dir"
  61      svn propset svn:ignore "*" tmp/sessions tmp/cache tmp/sockets
  62      echo "commiting tmp "
  63      svn commit -m "Ignoring all files in /tmp/"
  64      echo "Updating and commiting again...."
  65  
  66      svn update tmp/
  67      svn commit -m 'Ignore the whole tmp/ directory, might not work on subdirectories?'
  68      echo "Moving database.yml to database.example"
  69      svn move config/database.yml config/database.example
  70      echo "commiting..."
  71      svn commit -m 'Moving database.yml to database.example to provide a template for anyone who checks out the code'
  72      echo "Ignoring database.yml , updating and commiting..."
  73      svn propset svn:ignore "database.yml" config/
  74      svn update config/
  75      svn commit -m 'Ignoring database.yml'
  76      echo "Finished."
  77  
  78  else
  79      echo "Unknown Input. Terminating..."
  80  	exit 0
  81  fi
created by leozera — 15 November 2008 — get a short url — tags: rails subversion embed