Drupal CVS bash commands

I thought I'd share these Drupal CVS bash commands I regularly use when creating patches. You can simply copy paste them into your ~/.bash_aliases file. All commands are expected to be executed from a Drupal CVS checkout folder.

drupal_create_patch() {
  cvs -q diff -uRp . | grep -v "^\?" > /home/jensen/Desktop/jsomers_$1_$2.patch
}

drupal_update() {
  chmod u+w sites/default # Make folder writeable
  cvs -q update -dPC # Perform update and restore from repository
  chmod u-w sites/default
  find . -name '.#*' | xargs rm -f # Remove backup files
}

alias dpupdate='drupal_update'
alias dppatch='drupal_create_patch'

The dpupdate command will make the sites/default folder writable, perform an update and restore locally changed files to the latest repository version, remove the write permission from the sites/default folder and remove any backup files created by the update command.

The dppatch command will create a patch. Modify it to your needs. When calling this command I specify 2 parameters, the first is usually the issue numbers and the second one is my patch number. Hence using the command

dppatch 1000 2

will create a file called jsomers_1000_2.patch and place it on my Desktop.

Comments

Pingback

[...] In my previous post I talked about some useful Drupal CVS aliases. During the Core patch review sprint this [...]

Post new comment

The content of this field is kept private and will not be shown publicly.
  • Web page addresses and e-mail addresses turn into links automatically.
  • Allowed HTML tags: <a> <em> <strong> <cite> <code> <ul> <ol> <li> <dl> <dt> <dd> <br> <br />
  • Lines and paragraphs break automatically.
  • Textual smileys will be replaced with graphical ones.

More information about formatting options