Home > Development, English, Techie > Make a patch of the complete files modified by commits

Make a patch of the complete files modified by commits

I don’t know how to call this post. I have a problem with patch (I’m too bad to get it t work properly) so I want to export a list of the files I have modified between two subversion commits. This is how I do it for now (I’m sure it’s extremely perfectible).

svn co http://mysvnproject/trunk/project@1

This gets me the first version

svn update > diff-files.txt

This updates my copy to the latest version, but most importantly, it generates a list of files that have been updated or added. Something like this:

U    whoisonline.php
U    main/blog/blog.php
U    main/auth/my_progress.php
A    main/auth/user_list.php
U    main/auth/profile.php
A    main/auth/profile2.php

Now I want to edit the resulting file and remove the first characters of each line. Can do that with VIM’s command:

:% s/^[AU]   //

Now I have a file that is a list of only the files I want. Let’s put them into a TAR archive:

tar zcvf diff-files.tgz `cat diff-files.txt` –exclude-vcs

The exclude-vcs option is a genius option that allows me to ignore all the .svn, .CVS or whatever versioning system files there are.

You now have a diff-files.tgz file containing all the files you need to get your “pseudo-patch” working.

Categories: Development, English, Techie Tags: ,
  1. No comments yet.
  1. No trackbacks yet.

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

%d bloggers like this: