Discussion:
Making Patch .zip files
JoeyB
2009-12-09 17:16:25 UTC
Permalink
Hi All,

I can't believe I cannot find this anywhere on the net. I feel stupid
for asking it but here goes:
I want to create a .zip file that contains all the files that have
changed between two tags (say between tag "A" oldest to tag "B"
newest) on a branch in CVS. So, I would like to create a folder
structure that contained ONLY the changed files between these two
tags. Then, I could zip this folder structure up that included only
the changed files, give it to someone, they could un-zip this on top
of their older release copy of the code (for example, a release copy
released at tag "A") and be up to tag "B". I can't find any way to do
this in CVS. All I can find is a lot of references to .patch files
that indicate what exact changes are in the files. That's great but
what do I do with that? I can't find anything that explains what use
a .patch file is.

Is there any way to call a checkout of just the changed files between
two tags? Can CVS checkout a folder structure that contains just the
files that have changed between two tags? What good is a .patch file
anyway? What would I do with it?

Thanks,
Todd Denniston
2009-12-10 19:23:46 UTC
Permalink
Post by JoeyB
Hi All,
I can't believe I cannot find this anywhere on the net. I feel stupid
I want to create a .zip file that contains all the files that have
changed between two tags (say between tag "A" oldest to tag "B"
newest) on a branch in CVS. So, I would like to create a folder
structure that contained ONLY the changed files between these two
tags. Then, I could zip this folder structure up that included only
the changed files, give it to someone, they could un-zip this on top
of their older release copy of the code (for example, a release copy
released at tag "A") and be up to tag "B". I can't find any way to do
this in CVS. All I can find is a lot of references to .patch files
that indicate what exact changes are in the files. That's great but
what do I do with that? I can't find anything that explains what use
a .patch file is.
just popping RevB files into a sandbox can cause significant problems, the least of which is the one
I mention at the end of my patching example.
Post by JoeyB
Is there any way to call a checkout of just the changed files between
two tags? Can CVS checkout a folder structure that contains just the
files that have changed between two tags?
What good is a .patch file
anyway?
a patch file is:
a) smaller than sending the whole thing, if you know what both sides started from.
b) defines only what changed between revisions, so that the receiving side can apply the same
changes but if needed intermix those with changes they have made too.
c) machine readable to do (b)

http://en.wikipedia.org/wiki/Patch_(Unix)
Post by JoeyB
What would I do with it?
Thanks,
You are talking about using a .zip file instead of .tgz or .tar.bz2, SO I kind of have to assume you
or your partner are using windows and not with cygwin.

Because windows is in the loop things get interesting.

If you were on Unix or had mentioned Cygwin the following would have been the suggestion (assuming I
remember my rdiff and patch commands correctly):
1) at the server:
cvs rdiff -u -rA -rB module > AtoB.patch 2>&1
2) at the client
cd /path/to/dir/holding/module
patch < AtoB.patch
### HOWEVER when someone finally takes the remote sandbox to a system
### where they can update/checkin there will be some issues with the patches
### causing "conflicts" IIRC, because they change the same lines of code that
### cvs will be wanting to update during the update/checkin. (minor but annoying issue)

With windows only... _probably_ the best way would be to:
1) on client:
cd \path\to\dir\holding\module
zip -r module.zip module\
mv module never_work_in_this_tree_again
2) on windows client local to server:
unzip module.zip
cd module
#change all the user info to you in the CVS directories
cvs update
#change all the user info back to original in the CVS directories
cd ..
zip -r module_updated.zip module\
3) on client:
unzip module_updated.zip

I don't know if CVSNT has a disconnected mode that you can use or some way to do patching, but you
should consider asking your question in that list:

Following list borrowed from Arthur Barrett
CVSNT newsgroup:
http://www.cvsnt.org/cgi-bin/mailman/listinfo/cvsnt
or
news://news.cvsnt.org/support.cvsnt
WinCVS newsgroup:
http://groups.yahoo.com/subscribe/cvsgui
TortoiseCVS newsgroup:
http://sourceforge.net/mail/?group_id=48103

OH, BTW I have not tested any of the above, if it break things, then you get to keep all the chunky
bits... backup first. :)
--
Todd Denniston
Crane Division, Naval Surface Warfare Center (NSWC Crane)
Harnessing the Power of Technology for the Warfighter
Arthur Barrett
2009-12-10 20:48:14 UTC
Permalink
Todd/Joey,
Post by Todd Denniston
Post by JoeyB
I want to create a .zip file that contains all the files that have
changed between two tags (say between tag "A" oldest to tag "B"
newest) on a branch in CVS. So, I would like to create a folder
structure that contained ONLY the changed files between these two
tags. Then, I could zip this folder structure up that included only
the changed files, give it to someone, they could un-zip this on top
of their older release copy of the code (for example, a
### HOWEVER when someone finally takes the remote sandbox to a system
### where they can update/checkin there will be some issues
with the patches
### causing "conflicts" IIRC, because they change the same
lines of code that
### cvs will be wanting to update during the update/checkin.
(minor but annoying issue)
Todd - did you write this before your morning coffee?

If the other party has a CVS sandbox then the easiest way is simply to
get them to update to tag 'B'.

I think Joey means that the other party has an 'export' so they can't
simply 'cvs update' in which case a unified diff followed by a 'patch'
Post by Todd Denniston
If you were on Unix or had mentioned Cygwin the following
would have been the suggestion (assuming I
cvs rdiff -u -rA -rB module > AtoB.patch 2>&1
2) at the client
cd /path/to/dir/holding/module
patch < AtoB.patch
Cygwin is so last decade - Microsoft 'services for unix' has 'patch' and
there are plenty of other native windows patch's out there, eg:
unxutils.sourceforge.net.

However I am a little surprised that we've never added 'cvs applypatch'
to CVSNT or TortoiseCVS hasn't added 'Apply Patch' (it already has 'Make
Patch') - it seems logical to me that one or the other should have it...
Thanks for the idea, I'll get it added to CVS Suite and give Torsten the
TCVS patches for him to decide about adding them to the project.

Regards,


Arthur Barrett
Arthur Barrett
2009-12-11 20:46:02 UTC
Permalink
Joey,
Oops. Should have hit 'reply' not 'reply to author' I don't see my
latest post in the group. Can you copy my stuff in your reply Art?
Sure - best to hit 'reply all'.
Thanks all for the responses. I see now I should have been more clear
in my original post. My application is written in Matlab. My users are
all using MS Windows. The users of my application get a .zip file
that is a folder structure with of about 500 files in various
subfolders. So, when I give my application to a user, I'm giving them
a .zip file that contains these files in their respective folders.
They unzip it, open Matlab, add these folders to their Matlab path and
they're up and running. Matlab is interpreter based, no compilation on
my part, no install application, etc. My release is simply a copy of
my source code that sits on the client's machine.
Sometimes, we'd like to just give them a 'patch .zip file' that they
could unzip over their original folder structure that's on their
machine. This 'patch .zip' file is not a complete copy of the code.
It's only the changes since the last release. If the user unzips this
patch over their original copy of the code, it replaces changed files,
add new subfolders and possibly new files. Let's say their first
installation was the code at tag 'a'. Let's further say I just made a
bunch of changes and just tagged it all as tag 'b'. Now, I'd like to
make a .zip file to send my users (they're users. they don't have CVS)
that contains only the changed files, added files and possibly added
folders between tag 'a' and tag 'b'.
I personally do not think that ZIP is very good for this, you will need
to rely on your customers unzipping myappv1.zip, myappv1apatch.zip and
myappv1bpatch.zip in the correct order - and deal with the support
e-mails from customers who unzip them in the wrong order. If you switch
to MSI and MSP files then the windows installer subsystem included by
microsoft will manage all this for you. You can use Wix to build you
installer or one of many paid/commercial apps with nice GUI's etc.

More info:
http://msdn.microsoft.com/en-us/library/aa370578(VS.85).aspx
In CVS, I would like to do a checkout of ONLY the files that are new
or have changed between two tags. I'd like them to be placed in their
appropriate folders. NO CVS folders - this is NOT a sandbox.
This is a frequently asked question - please read the book you've bought
that describes how to use CVS (eg: 'All About CVS' which I had a hand in
writing, or 'Essential CVS' or one of many others) - and/or look at
previous newsgroup posts.

reports on differences between Tags:
http://lists.gnu.org/archive/html/info-cvs/2009-05/msg00026.html

** click 'next in thread' to see each reply - the one from Mark Risman
is probably what you want. ***

Getting a list of files by date:
http://lists.gnu.org/archive/html/info-cvs/2009-08/msg00049.html

List the changes files between 2 dates on specific branch:
http://lists.gnu.org/archive/html/info-cvs/2009-05/msg00052.html
I'm using
TortoiseCVS now. What's 'cvs applypatch' ? Will this do what I've
described? Where do I get it?
The idea behind open source ('free'dom) software is that you get the
source code and improve it. This is what Todd and I were discussing.
'cvs applypatch' will be available when you or I or someone else writes
it and submits the change back to the project.
Again, thanks to both of you for your help.
Regards,



Arthur Barrett

Loading...