July 2007 Archives

CVS leapfrog

| | Comments (2192)
I don't do this very often, but on occasion I find my self working on functions in a bit of code, but forget to branch the new changes.  Of course every time I do that I find I need to go back and do bug fixes on the "old" code.

Here is how to do a somewhat graceful code leap frog in CVS.

  1. cvs commit file (commit your current working changes prior to any bug fixes)
  2. cvs up -r $rev_of_working_code file
  3. mv file file.bak
  4. cvs up -A file
  5. cp file.bak file
  6. <make bug fixes here>
  7. cvs commit -m "leapfrog from $rev_of_working_code for bug fix" file

Your old code is now at head with the bug fix.  Now you most likely want to go back to what you were working on. Depending on how complex your changes are there are two ways to do this.

Simple method:

  1. cvs up -j $rev_of_head -j $rev_of_code_before_leapfrog file
  2. cvs up -j $rev_of_working_code -j $rev_of_head file  (you will most likely get a few conflicts.  if the conflicts are over whelming then try the next method)
  3. cvs commit file

Slightly more complex method:

  1. cvs up -r $rev_of_code_before_leapfrog file
  2. mv file file.bak
  3. cvs up -A file
  4. cp file.bak file
  5. cvs up -j $rev_of_working_code -j $rev_of_head file 
  6. cvs commit file

Example:

Current version: 1.16
Code that needs bug fix: 1.15

  1. cvs commit Admin.pm (results in 1.16)
  2. cvs up -r 1.15 Admin.pm
  3. mv Admin.pm Admin.pm.bak
  4. cvs up -A Admin.pm
  5. cp Admin.pm.bak Admin.pm
  6. <apply bug fixes>
  7. cvs commit -m "leapfrogging 1.16 for Bug# 1234" Admin.pm (results in 1.17)
  8. cvs up -j 1.17 -j 1.16 Admin.pm
  9. cvs up -j 1.15 -j 1.17 Admin.pm
  10. cvs commit -m "bringing back changes from 1.16 with bug fixes in 1.17" Admin.pm
  11. joy
I acquired a Logitech Revolution MX a few months back.  I immediately fell in love, but I was having problems getting all the buttons to work under linux.  I found a hack on the ubuntu forums describing how to enable some basic functionality.  After going through that hack I had a middle mouse button again... Yay.

After running into a problem where my numpad doesn't output anything in KDE I grabbed a new keyboard.  The new keyboard's numpad also didn't work.  I began to suspect a configuration problem.  After digging around I ran into a thread about BTNX and the MX revolution.  

I installed BTNX and it works like a champ.  I have not only my middle mouse button functionality (the search button), but I can use the thumb wheel, the left-right functions on the scroll wheel etc.  Check out the forum entry at:
After converting my home page to use Movable Type as a CMS I find that I happen to have Movable Type installed...  I guess that means I can join the blogging craze.  I intend to use this primarily as a spot to journal cool tips, hacks and other work arounds as I find them.  I suppose I will also write about paintball events and other personal happenings if they are significant enough to warrant a public shout-out.  


About this Archive

This page is an archive of entries from July 2007 listed from newest to oldest.

September 2008 is the next archive.

Find recent content on the main index or look in the archives to find all content.

Powered by Movable Type 5.04