Using SVN 1.7 commands on upgraded Drupal modules.

Ki Kim's picture

These svn commands are not particularly version 1.7, but works well with upgrading Drupal modules.

After replacing module folders and when ready to commit the code change to svn repository:

# Remove dropped files

$ svn st | grep '^!' | awk '{print $2}' | xargs svn rm

# Add new files

$ svn st | grep '^?' | awk '{print $2}' | xargs svn add

# To add, this works too (Make sure you are at directory level that has no ignored files; otherwise --force will add ignored files as well)

$ svn add --force .

# Commit

$ svn ci -m "Upgraded a module."

If you are using svn 1.6, overwrite folders instead of replacing to keep hidden .svn folders. Then the command above should work too. There will be no files getting dropped when overwriting.



very nice post Thank you!

outstanding work. see you,

I've never really figured out xargs, so the version of the find command i use is this: find . -name .svn -exec rm -f {} \; The braces cause the file name and path to be inserted, then you need to semicolon (escaped) to end the command. Another good variation on this is using grep. grep -H will put out the file name. Hope that helps, Mark

Add new comment

Plain text

  • No HTML tags allowed.
  • Web page addresses and e-mail addresses turn into links automatically.
  • Lines and paragraphs break automatically.
To prevent automated spam submissions leave this field empty.
This question is for testing whether or not you are a human visitor and to prevent automated spam submissions.