updated ruby utilities to work with hierarchical repo checkouts

1 view
Skip to first unread message

Stephen Bannasch

unread,
Jan 25, 2009, 3:00:10 PM1/25/09
to otrun...@googlegroups.com
I updated the ruby script flatten_projects.rb and added
create_workingsets.rb. Both of these scripts are in the main CC
subversion repository at this level.

http://svn.concord.org/svn/projects/trunk/common/

The script flatten_projects creates a top-level workspace/ dir with
symbolic links to
all the Eclipse projects under the java/ dir hierarchy.

I am using this to work with a Git clone of the whole svn repo at this level.

This technique appears to work fine with the Subversion Team
provider. The egit Git Team provider does not yet work with symbolic
links properly, see:

http://code.google.com/p/egit/issues/detail?id=52

The last message in this thread has a suggestion on where the problem
might be in egit:

http://n2.nabble.com/egit-problem-with-sym-linked-eclipse-project-dirs-td2153050.html

This problem with egit means that I need to use the shell and other
utilities to create branches, commit locally, resolve merges, rebase
to the svn repo, etc -- instead of using the egit Eclipse plugin.

If you want to experiment with the git-svn clone technique I
recommend starting by grabbing and expanding this archive which is
kept up-to-date:


http://rails.dev.concord.org/archive/concord-projects-common.svn.git.tgz
(846MB)

This archive is updated once a day. After expanding it do:

git svn rebase

to update to the latest Subversion revision.

Doing the initial git svn clone operation on a repository as large as
this takes several hours.

To make initial startup with git-svn clones faster archives are created
once a day (3:12 AM) of git-svn clones of the following projects in
CC's Subversion repositories

SVN repo: http://svn.concord.org/svn/projects/trunk/common/
Git-svn archive:
http://rails.dev.concord.org/archive/concord-projects-common.svn.git.tgz

SVN repo: http://svn.concord.org/svn/sds
Git-svn archive: http://rails.dev.concord.org/archive/sds.git.tgz

SVN repo: http://svn.concord.org/svn/diy
Git-svn archive: http://rails.dev.concord.org/archive/diy.svn.git.tgz

SVN repo: http://svn.concord.org/svn/ccsailportal
Git-svn archive: http://rails.dev.concord.org/archive/ccsailportal.svn.git.tgz

Here's a copy of the documentation in the comments in flatten_projects.rb:

---------------------------------------------------------------------------

This script is the first part of two ruby scripts that can be used to
help setup Eclipse so you can checkout and work with a hierarchical directory
structure that mirrors that used in the repository.

The scripts assume you have a directory structure that mirrors the repository
at this node in the tree:

https://svn.concord.org/svn/projects/trunk/common

The checkout can be done with Subversion, using Git to clone the Subversion
repository, or using a Git clone of a Git mirror of the Subversion repository.

Subversion:
svn co https://svn.concord.org/svn/projects/trunk/common
concord-projects-common.svn

Git clone of the Subversion repository:
git svn clone -Tcommon --prefix=svn/
https://svn.concord.org/svn/projects/trunk
concord-projects-common.svn.git

Git clone of the Git mirror of the Subversion repository*:
git clone git://gitorious.org/otrunk-examples/mainline.git
concord-projects-common.svn.git

*The name 'otrunk-examples' in the url is misleading due to an error
setting up the Git mirror.

After checking out the repository cd into the local workoing
directory and run flatten_projects.rb

ruby flatten_projects.rb

This will create a new dir named 'workspace' at the top level with
symbolic links
to all the directories under the path java/ that have an Eclipse
.project file inside them.

The result should be a dir that emulates the flat project space that
Eclipse needs
see: Eclipse bug: https://bugs.eclipse.org/bugs/show_bug.cgi?id=35973

Open Eclipse, switch to a new Workspace, select the newly-created
'workspace' dir and import
the all the projects (or just a subset you want to work on).

After Eclipse finishes building quit Eclipse and run create_workingsets.rb

ruby create_workingsets.rb

This will create Eclipse working sets that mirror the directory
structure used to organize
the projects in the repository. There are many projects and this
categorization is useful.

Start Eclipse and in the Java Package Explorer:

1) Configure 'Top Level Elements' to show 'Working Sets'
2) Select 'Configure Working Sets...' to enable all the listed working sets.

Stephen Bannasch

unread,
Feb 27, 2009, 1:55:23 PM2/27/09
to otrun...@googlegroups.com
>I updated the ruby script flatten_projects.rb and added
>create_workingsets.rb. Both of these scripts are in the main CC
>subversion repository at this level.
>
> http://svn.concord.org/svn/projects/trunk/common/
>
>The script flatten_projects creates a top-level workspace/ dir with
>symbolic links to
>all the Eclipse projects under the java/ dir hierarchy.

Scott had a suggestion to use hard links instead of symbolic links. I
implemented this in flatten_projects.rb and this works quite well.

I still need to do my updates from svn to my local git clone and
commits from my git clone back to svn from the command line because
the Elcipse Git plugin egit only works with git repositories -- it
doesn't implement the commands for git<=>svn integration.

I created a simple shell script to set all this up:

http://gist.github.com/71635

But haven't tested it yet because the initial download of the tar.gz
archive is over 350 MB.

Reply all
Reply to author
Forward
0 new messages