jensen

Are you pondering what I'm pondering?
  • Blog
  • Archive
  • About Me
  • Contact
Home

cvs

Adding new files to CVS without write access

Submitted by jensen on April 26, 2009 - 9:47pm

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:

cvs add

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.

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

  • Add new comment
Tags:
  • bash
  • cvs
  • development
  • drupal

Drupal CVS bash commands

Submitted by jensen on April 20, 2009 - 8:33pm

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.

  • 1 comment
Tags:
  • bash
  • cvs
  • development
  • drupal
Syndicate content

Tags

blog cck cvs development drupal foss hosting jsomers linux php tinymce ubuntu
more tags

Buttons

I love Smashing Magazine!
This is a personal web page. Things said here do not represent the position of my employer or any organization I am associated with unless otherwise noted. Everything on this website is licensed under the Creative Commons Attribution-Share Alike 3.0 Unported license.
Fervens Drupal theme by Leow Kah Thong. Designed by Design Disease and brought to you by Smashing Magazine.