Taking Care of Those Pesky CVS Entries.Log Files After Updating Your Drupal Module !

Sometimes when I update a Drupal module or core install, some CVS files are removed - namely Entries.Log files. When you go to svn up your changes, it will complain saying that there are files in your repository that no longer exist in your working copy (signified by the ! mark). To get rid of these, try using the following bash script (you can put this in your .bashrc file in *nix, if you're using the bash shell of course):

# Filter out what you want from an svn st (status) and do something with it.
# This is great for deleting CVS Entries and Log files that SVN
# complains about not existing on your working copy anymore from SVN
# A good overview of this is on http://gotdrupal.com/videos/svn-filtering
# Modified from http://ceardach.com/
svngrep()
{
  if test -z "$2"; then
    svn status | egrep "${1}" | awk '{print $2}'
  else
    svn ${2} `svn status | egrep "${1}" | awk '{print $2}'`
  fi
}

For example, try:

svngrep '^!.*Entries\.Log' 'rm --force'

This will run an svn status, filter out all but the missing Entries.Log references and remove them! Run svn status again and the inconsistencies should be gone!

Post new comment

  • Web page addresses and e-mail addresses turn into links automatically.
  • Allowed HTML tags: <em> <strong> <cite> <code> <ul> <ol> <li> <dl> <dt> <dd> <h1> <h2> <h3> <h4> <h5> <h6> <img>
  • You may post code using <code>...</code> (generic) or <?php ... ?> (highlighted PHP) tags.
  • Lines and paragraphs break automatically.

More information about formatting options