Looking for a distributed version control system...

  • Thread starter Deleted member 43669
  • Start date
Status
Not open for further replies.
D

Deleted member 43669

Guest
On my last projects, I have adopted a peculiar source management system.

I create a base project in Subversion, which has a hierarchy of all the subprojects in my project and their versions:

Code:
/projectA/main
/projectA/branch1
/projectB/main
/projectB/branch1
/projectB/branch2
...

Each of the "version" folders, contains an Ant script which pulls the source from that project and version, pulls projects it depends on into the corresponding place in the hierarchy, builds them, pulls external dependencies (jars, zips, etc.) from a binaries repository, copies the artifacts generated from the dependent projects and external deps into the proper place within the project and then builds the project.

I know this is like Maven, but reinvent-the-wheel style. But it is a much simpler wheel.

I'm looking for a DVCS that works well with this system, which integrates well into Eclipse, and a way to get the benefits of DVCS added to the system.

Thoughts, ideas?

Alex
 
First of all, you haven't quite made it clear how you want your DCVS to fit into this.

If you want to have a central SVN repo where all devs check in regression-testing-ready patches, and keep your personal development (the intermediate commits between commits that are patch ready) under revision control, then any DCVS can do that for you. You simply initialize your client view of the repo as a git/Hg repository and ignore what you don't need. (It really doesn't matter which you chose, but I know git, so the rest of this will be written in git teminology). Periodically stash your changes, suck down head (heh) from SVN, and then rebase your work onto the new head.

Second of all, if you want to replace SVN with a DCVS, then the wheel you are reinventing is not called Maven, it is called "branches". This architecture is completely wrong for a DCVS, (and even in a SVN repo, I would not make my branches as folders). I would simply make my branches, into, well, branches.
 
D

Deleted member 43669

Guest
No, no, my branches are actually branches in Subversion- and obviously I'd want branches to be branches in whatever DVCS I choose...

What I want is to keep interdependent projects in DVCS. Now I have a metaproject which contains how all are projects (and their branches) built and how dependencies between them work.

I want to do something like...

Code:
metaproject$ cd project1/trunk
trunk$ ant build
[...] project1/trunk gets pulled from DVCS, dependencies are built and binaries are moved into trunk/project1/lib then project1 is built

edit: one of the things I see as wrong when moving to a DVCS is that... in my old system with Subversion, I can just pull whatever I need for the current project I'm building... as I see, a DVCS checkout means you pull the entire repository, so my old model doesn't quite fit into DVCS, for instance...
 
Ok, now I understand better what you're trying to accomplish. My first thought is: If project A and project B are interdependent, then they are actually just one project. It seems like your "metaproject" is just doing one thing for you here: when you check out branch X in project A, then it checks out branch X in project B. All of the information about how projectA-rX works with projectB-rX should be kept in the projectA-rX branch, so that it can be versioned along with the rest of projectA-rX. If projectA and projectB were re-envisionsed as a single project, then you could do that without a metaproject. Let the project keep track of itself, I say. If the only reason you are trying to break these projects up is performance - that's probably premature optimization.

In terms of checking out more stuff, you are right that DCVS clones are different from client views of a central repository, in that they keep history. But you don't have to check out branches that you don't care about, which should be roughly equal to "whatever I need for the current project I'm building" plus revision history for the same. (And this is necessary to take advantage of the best features of DCVS).
 

Josh

Ars Praefectus
3,533
Subscriptor
You can do this with git. The difference is that instead of having a single repository you will have multiple repositories. The android project uses a tool they built called repo to manage all their git repositories.

Alternatively you can use submodules in git to reference other git repositories from within a different repository. Submodules are a bit more advanced and complicated than what you have in SVN so you'll find you have a few extra scm steps in your scripts but they should work for your needs. I've been happy with submodules.

As for integrating with Eclipse I stick to the command line when using svn or git, but there is an Eclipse project for git called egit.
 
D

Deleted member 43669

Guest
I think I'm somewhat inclined towards Mercurial- I've been dabbling with Eclipse's Mercurial support, seen TortoiseHg and I've seen there's some Ant support.

What I believe I need is a way to adapt my workflow... I'm thinking something like the following

Code:
master_project/{project_name}/build.xml

Which checks out project_name, binary dependencies (from some other kind of repo, maybe a web server with binaries, maybe Subversion) and dependent projects, builds dependent projects and copies the binaries to the proper place, then runs the project's build.

I eliminate the "version" hierarchy, as each checkout contains the complete repository and it seems a waste of space (esp. if switching from one branch to another is a quick operation).

I'm tempted to branch master_project whenever I want to branch any small project, and branch all the small projects I need to branch. Would this pose a problem? Any way to handle this quickly?

Thoughts, ideas?

Alex
 

Xavin

Ars Legatus Legionis
30,828
Subscriptor++
I haven't been using DVCS long enough to say authoritatively, but in researching how to set up my own projects I have found the consensus is one repository per project. Neither Mercurial nor Git seem to deal with large monolithic repositories that well.

I use Mercurial on Windows and love it. I started with git, but the confusing terminology and terrible Windows tools put me off. Once I switched to Mercurial it all started making sense. Tortoise HG isn't quite as nice as Tortoise SVN, but it's very close, and I haven't run into any functional problems with it.
 
Status
Not open for further replies.