About the author

Steven HarmanSteven Harman is a passionate developer who believes that writing great software isn't just a job, its a craft.

ASP.NET MVP

For recent posts and more about me, scroll to the bottom.

Subscribe

  • Subscribe to my feed. via RSS
  • Subscribe via email via email

News

devLINK Technical Conference

Jobs

Badges

  • Subtext Project
  • Support Subtext
  • HiddenNetwork.com Banner

CVS - Keeping your branch(es) in sync...

So, I've blogged before about how I'm now working with the subText Project and how we've been doing a lot of work under the hood in preparation for the version 1.0 release, and how one of the things that I've been working on is an Upgrade framework. We've recently decided that we need to refactor/redesign the Import process we originally had in mind, and now we're playing with two different approaches. One approach is to implement BlogML in subText. The other is to use the Provider Model to leverage an existing blog engine's (i.e.- dotText, dasBlog, etc...) and subText's built-in object & data models to do data translation from the existing blog to a subText blog.

Anyhow, when I got ready to start building these Importers, the first thing I did was create a branch off of subText proper. The idea was that I would simply make my changes, test them, etc... and then at some point merge back into TRUNK. Good in theory, except that shortly after I branched, some of the other guys starting making a lot of changes to TRUNK, and my branch was quickly way out of date. Normally this isn't an issue b/c the merge will take care of. However, some of the changes on TRUNK were changes to the subText.Framework and I needed those changes to finish my work. So, now what?

Simple (right?), just merge from the TRUNK into my branch as described here. Wrong. I needed to keep working on my branch after the merge and then at some point bring my changes over to TRUNK, do more work on my branch, pull in any changes to TRUNK, merge my new changes back to TRUNK, and so-on and so-on... What I needed was a way to sync the branches. No biggie, just do a little Googling. NOPE! I found all kinds of examples of how to do multiple merges, but not the true sync that I needed. So, after much research/trial-and-error... I figured it out. And, I even made a nice little picture to illustrate the process! Check it out:

How-To: Keep your CVS Branch(es) in sync.

This process can be repeated as much or as little as needed. And you can update from the TRUNK as many times as you want to be sure you've always got the latest-and-greatest code, and then merge your changes back at any point.

I'm by no means a CVS Guru, and I'm sure there are probably better ways to do this, but I couldn't find them... so this is how I'm doing it! At least for now :) So, if you know of a better way, have questions about the process, advice, etc... post a comment below and let me know!

Hope This Helps!TM

Update/FYI:
For anyone out there that is new to CVS/Version Control (or those of use just looking for a refresher), I found a great read [via Haacked] entitled Source Control HOWTO. In his guide, Eric does a great job of laying out the basics of source control and then moving into the most common day-to-day tasks that a developer will tackle. Eric plans to continually expand this guide and delve even deeper into effective source control. Read On, and Good Luck!

What others are saying.

# Thanks!
Gravatar Pingback/TrackBack
Dec 13, 2005
Thanks for the nod Phil! Also, anyone who has any questions/comments/suggestions on this topic, please don't hesitate to contact me (or just leave a comment on my original post). -Steve
# re: CVS - Keeping your branch(es) in sync...
Gravatar Gurkan Yeniceri
Dec 14, 2005
Awesome. I will follow your guidelines for the "Mail to Weblog" extension on subText.
# re: CVS - Keeping your branch(es) in sync...
Gravatar Koba
Feb 21, 2006
Hi Steve,

It looks like you left out the "update" command on your merge steps above.

Otherwise, thanks for documenting this... it is very helpful!

Kyle
# re: CVS - Keeping your branch(es) in sync...
Gravatar Steve Harman
Feb 21, 2006
Kyle,
Thanks for the feedback.

I know the graph above doesn't explicitly show each "update" coming in from the repository to the Trunk and EXP_Branch, but I did that mainly to keep the diagram as simple as possible. However, I do have the update commands listed out in the "Process Flow" section. [See 2nd step of B, and 1st step of D].

I updated the graph a little bit to make it a bit easier to tell what step in the flow goes with which arrows. Oh, and I also expanded some of the comments in the "Process Flow" section to help hilight the what we're doing at each step.

Thanks again for feedback, and good catch.
# re: CVS - Keeping your branch(es) in sync...
Gravatar Haacked
Feb 21, 2006
Steve, he was referring to the command line options within the "Process Flows" section.

For example, in step B you have the command:

> cvs -j "lastUpdate" -j "HEAD"

should be:

> cvs update -j "lastUpdate" -j "HEAD"

Phil
# re: CVS - Keeping your branch(es) in sync...
Gravatar Haacked
Feb 21, 2006
I meant "cvs" not "cd"
# re: CVS - Keeping your branch(es) in sync...
Gravatar Steve Harman
Feb 21, 2006
Ahh... now I see. I'll attribute that to an ID 10 T error on my part. Thanks for clearing that up Phil.

Kyle,
Sorry about the misunderstanding... I'll fix that graph ASAP.

Thanks again fellas!
# More on Source Control and Visual Source Safe 2005
Gravatar Erik Lane
Sep 20, 2006
More on Source Control and Visual Source Safe 2005
Comments have been closed on this topic.