CVS

23 December, 2008

I keep all my Drupal sites up-to-date by updating a single Drupal core instance and one install profile. And I keep Drupal core and all modules in this install profile updated through CVS. But then a problem poses: what if a file was added to or removed from CVS? Until now, you’d have to manually svn add or svn rm the file. And in the case of some modules (e.g. Views), that’s a lot of files you’ll have to check.

The solution: syncvsvn {#solution}

I’m aware that this probably isn’t the best name, but it gets the job done :).

Suppose you’ve just updated the xmlsitemap module:

30 October, 2007

Ever been disgruntled by the fact that you can’t do a cvs diff with new files, because you haven’t got write access on a Drupal contrib module’s CVS repository and thus can’t cvs add those new files? There’s a solution though: edit CVS’s Entries file. But who likes manually modifying files over and over again?

The solution: fakeadd! (I’ve attached the file to this post in case this site ever goes down.) This nice shellscript allows you to update the Entries file using a simple syntax: fakeadd newfile.php.

A quick install how-to:

  1. Save the file to a location of your choice, I’ve saved it in ~/scripts.

  2. Open your ~/.bash_profile file (if you’re using the bash shell, this is the default shell on OS X) and add the following:

    # Add custom scripts, such as the CVS fakeadd script.
    export PATH=$PATH:~/scripts` 
    
  3. Make the script executable: chmod +x ~/scripts/fakeadd.

  4. When you create patches (also see this blog post of mine), use the -N flag. So your eventual command will look like this: cvs diff -N -up > foo.patch.

Tags

29 July, 2007

Add these lines to your ~/.bash_profile if you’re using the Bash shell:

alias ddiff="cvs diff -u -F^f -N > "
alias dhead="cvs -z6 -d:pserver:anonymous:anonymous@cvs.drupal.org:/cvs/drupal checkout drupal"
alias dupdate="cvs update -dP"

Now you have three new commands at your disposal:

ddiff : Usage: ddiff patchfile.patch, creates a patch file.

dhead : Usage: dhead, checks out Drupal HEAD in the current directory.

dupdate : Usage: dupdate, updates the current directory recursively.

Update on August 10, 2011

While cleaning up my ~/.bash_profile file, I came across the following functions that I’ve used for many years and shared with several other Drupal developers. These are now obsolete, thanks to Drupal.org’s migration from CVS to git.