cvs
Adding new files to CVS without write access
In my previous post I talked about some useful Drupal CVS aliases. During the Core patch review sprint this weekend! I noticed a problem with it: adding new files.
Normally new files are added to CVS using the command:
The problem is that this command fails without write access to the repository. Luckely there is a handy little tool called fakeadd which you can use to edit the CVS entries file and let it look like the new files have been added to the repository. The patch creation function also changes by adding the -N option.
cvs -q diff -uNRp . | grep -v "^\?" > /home/jensen/Desktop/jsomers_$1_$2.patch
}
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.
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
will create a file called jsomers_1000_2.patch and place it on my Desktop.
