We’ve been playing with how we work with Drupal CVS while setting up our own in-house version control system, and we came up with a rough sketch we wanted to document and share. The ultimate goal is to create a robust work-flow where multiple developers can share code through multiple Drupal-based projects, keeping track of internal changes and also keeping the code up-to-date. We want to track code internally in subversion, while also tracking it against Drupal CVS. We have a method to manually check our code against Drupal CVS that I’ll outline below, but we’re interested in hearing if anyone else doing something along these lines that they might be willing to share.
How we’ve been working
We’ve been checking our Drupal code out of CVS through Eclipse. Besides some issues getting the “-p” option in created patches, we’ve found it works pretty well. We can check out, compare, manage patches all with a quick right click of the mouse. This allows our code to stay up to date. We've been considering moving up to PDT, but we ran into some problems and decided to stay with PHPEclipse for now.
We don’t want to maintain our own distros of contrib modules, and we’re definitely anti-fork, but sometimes we find it good to have "our" latest and greatest development code that we can check against the latest Drupal repository. This often happens when we’ve applied a patch (sometimes one that we submitted) that’s still in the queue. Sometimes the patch has been applied to the dev version, but has not been included in a full release yet. We want to stay on the full release, but we need to patch in our latest work. Eventually we will upgrade to the new release with the patch included, whether it’s two weeks into development or six months later when we’re upgrading to the next version.
What we want to do
The need to track our own code is very important. We want to sync custom themes, custom helper modules, and patched contributed modules with the rest of the development team. We want our own versioning internally.
At various points in the process, we’d like to also check the version of a contributed module in development against the current status of the module. This leaves us in a place were we will be trying to work against two repositories. Given some of the technical hurdles we were running into doing this with Eclipse, we are moving towards making this a manual process where we will need to compare how the current module has progressed against the snapshot we have.
Our current plan
Our current process is shaping up to something like this:
- Create a new PHP project in Eclipse.
- Check out the latest versions of Core and all contributed modules we want to use.
- Copy all contents of the project to a new project.
- Commit the full version of this new project into Subversion.
- Manage development and changes through Subversion.
- To compare current code to Drupal CVS, create a new project, import it from CVS, copy and paste code from the subversion project through Eclipse. Right click and choose “Compare with.”
- To replace current code with code from the Drupal repository, create a new project, import from CVS, copy and past to the Subversion project and commit your changes.
The last two points seem a bit tedious. There's some argument for leaving this a manual decision, which is what we're going with, but it seems there should be a way to better leverage the technology. This is probably the part we are most unsure about, and we'd be interested to see if anyone else has had luck with making this work in a more efficient manner.
Another caveat that we're examining in the need to make sure we document what versions of a contrib module we are using. Once we check it into subversion, all CVS entries are effectively gone. This requires us to keep a master list of what releases we are using for each module. This is another point where we are looking to minimize any confusion through better use of technology.
Thanks in advance for anyone else willing to share! If not, hopefully this will help someone else out there.
Comments
vendor branches
CVS has long had a notion of "vendor branches" for exactly this kind of thing. in fact, when i first came around drupal almost 1.5 years ago, it was the problems i faced trying to import some upstream drupal modules on to vendor branches in my own private repository that caused me to write the new release system. ;)
anyway, there's actually a handbook page all about this. it's specific to using CVS for this, but i'm nearly positive that SVN has the same notion of vendor branches, so the principles should still apply, even if the details (specific commands, arguments, etc) are different.
http://drupal.org/node/5123
cheers,
-derek
___________________
3281d Consulting
Thanks
Thanks, derek, that's probably exactly what I was looking for. Not sure how I missed it the first time around. We'll dive into that and report back how adjust what we have above. (If we get something solid, we'll submit it to that section of the handbook.)
--------------------
Sean B. Fuller
www.seanbfuller.com
www.tractiv.com
--------------------
Sean B. Fuller
www.seanbfuller.com
Not sure if you've read this....
...but I talked a bit about our setup here:
http://drupal.org/node/118936
At the moment, our CVS working dirs (to/from drupal.org) and SVN working dirs (internal development) are separate and stuff gets copied (rsynced actually) between them in a semi-manual way with some scripts.
There is still scope for improving it. When I get around to it though I'm going to look further into how well CVS and SVN can share working directories to avoid a lot of duplication. A quick attempt a while back was only partially successful.
--
Anton
New to Drupal? | Troubleshooting FAQ
Example knowledge base built with Drupal
Do you use any svn clients?
Thanks, that was super helpful. One quick question: What do you use to manage code? Is everyone doing it at the command line or is there are preferred client you use? Was there anything you found one client or another could not accomplish?
I think we're considering svnX for mac and Tortoise for PC. We're still trying to decide if Eclipse will work for us for PC / Mac.
Thanks again.
--------------------
Sean B. Fuller
www.seanbfuller.com
www.tractiv.com
--------------------
Sean B. Fuller
www.seanbfuller.com
svn clients
I use TortoiseSVN when I'm on Windows and the command line when I'm on Linux. Actually TortoiseSVN is one of my only killer apps for Windows - I prefer Linux for just about everything else. On Linux I sometimes use RapidSVN for repo browsing.
Our designer uses TortoiseSVN on Windows, and tried svnX on his Mac. But he (and me as well) didn't really like svnX and we both found it kinda confusing and easy to screw things up with - others seem to like it though. So he does his text editing and subversion on Windows, but all his mockup and graphics stuff on his Mac.
We both use JEdit for text editing on Windows, but I have been wondering about trying out Eclipse - what are your thoughts on Eclipse so far?
--
Anton
New to Drupal? | Troubleshooting FAQ
Example knowledge base built with Drupal
For the past year I've been
For the past year I've been using PHPEclipse with the built-in CVS client and generally found it works well. The function outline for the current file is especially useful.
I'm still trying to decide on the Eclipse with PDT and Subclipse. Here is the download page:
http://download.eclipse.org/tools/pdt/downloads/
Note that you want the All-in-one download. I had a hard time trying to install the base Eclipse, then the PDT. Just grab the latest stable all-in-one and it works right out of the box. From there Subclipse is a pretty easy install. Make sure you adjust all the settings as well (see http://drupal.org/node/75242).
I finally went the all-in-one route yesterday and got everything set up fine. Two of the people in the office are running PHPEclipse on a mac and are happy with it. As long as nothing breaks for me, they'll probably be upgrading soon. I'll be working with it today and if I run into any issues I'll let you know.
--------------------
Sean B. Fuller
www.seanbfuller.com
www.tractiv.com
--------------------
Sean B. Fuller
www.seanbfuller.com