blob: 17d43d12651291d0f1c8f5330412695b07817fa6 [file] [log] [blame]
# create a local cvs root
mkdir cvsroot
cd cvsroot
cvs -d :local:$(pwd) init
# make a userful subdir to use
mkdir -p eclipse.platform.ui
cd eclipse.platform.ui
mkdir bundles examples features tests
# "fix" any of the main branches that you care about
# you need to run this script at least twice
# you also have to understand what tag for what date goes where.
# you have to list all of the modules you care about
MODULES='org.eclipse.core.commands
org.eclipse.core.databinding
org.eclipse.core.databinding.beans
org.eclipse.core.databinding.observable
org.eclipse.core.databinding.property
org.eclipse.jface
org.eclipse.jface.databinding
org.eclipse.jface.examples.databinding
org.eclipse.jface.snippets
org.eclipse.jface.tests.databinding
org.eclipse.jface.tests.databinding.conformance
org.eclipse.ui
org.eclipse.ui.carbon
org.eclipse.ui.cocoa
org.eclipse.ui.examples.contributions
org.eclipse.ui.examples.fieldassist
org.eclipse.ui.examples.multipageeditor
org.eclipse.ui.examples.navigator
org.eclipse.ui.examples.propertysheet
org.eclipse.ui.examples.presentation
org.eclipse.ui.examples.rcp.browser
org.eclipse.ui.examples.readmetool
org.eclipse.ui.examples.undo
org.eclipse.ui.examples.views.properties.tabbed/org.eclipse.ui.examples.views.properties.tabbed.article
org.eclipse.ui.examples.views.properties.tabbed/org.eclipse.ui.examples.views.properties.tabbed.hockeyleague
org.eclipse.ui.examples.views.properties.tabbed/org.eclipse.ui.examples.views.properties.tabbed.logic
org.eclipse.ui.ide
org.eclipse.ui.ide.application
org.eclipse.ui.navigator
org.eclipse.ui.navigator.resources
org.eclipse.ui.presentations.r21
org.eclipse.ui.tests
org.eclipse.ui.tests.harness
org.eclipse.ui.tests.navigator
org.eclipse.ui.tests.performance
org.eclipse.ui.tests.rcp
org.eclipse.ui.tests.views.properties.tabbed
org.eclipse.ui.views
org.eclipse.ui.views.properties.tabbed
org.eclipse.ui.win32
org.eclipse.ui.workbench
org.eclipse.ui.workbench.compatibility
'
# what base tag at what date, and what branch
TAG=R3_6
TDATE="06/22/2010 09:00"
BRANCH=R3_6_maintenance
for M in $MODULES; do
if (cvs rlog -rHEAD $M/.project | grep " ${TAG}:" >/dev/null); then
if (cvs rlog -r${TAG} $M/.project | grep " ${BRANCH}:" >/dev/null); then
echo Correct $BRANCH for $M
else
echo cvs rtag -b -r$TAG $BRANCH $M
fi
else
if ( cvs rlog -d "$TDATE" $M/.project | grep "selected revisions: 0" >/dev/null ); then
echo "Module empty on $TDATE"
else
echo cvs rtag -D\"$TDATE\" $TAG $M
echo cvs rtag -b -r$TAG $BRANCH $M
fi
fi
done
# Then fix the other tags. TAG1 is a known tag (like from above :-)
TAG1=R3_6
TAG2=R3_6_1
for M in $MODULES; do
if ! (cvs rlog -rHEAD $M/.project | grep " ${TAG2}:" >/dev/null); then
echo cvs rtag -R -r${TAG1} ${TAG2} $M
else
echo Already tagged ${TAG2} $M
fi
done
# copy over from modules
cd /cvsroot/eclipse
MODULES="org.eclipse.core.commands ..."
for M in $MODULES; do cp -r $M /shared/eclipse/e4/git/cvs/cvsroot/eclipse.platform.ui/bundles; done
# move them into tests or examples, as they're all in bundles.
# try and generate some author data
find org.eclipse.ui.workbench -name "*,v" -exec grep "^date.*author " {} \; >author.raw
grep -v "Binary file" author.raw | sed 's/^date.*author //g' | sed 's/;.*$//g' | sort -u >author.ids
for ID in $( cat author.ids ); do
ENT=$( getent passwd $ID )
if [ $? -eq 0 ]; then NAME=$( echo $ENT | cut -f5 -d: ); else NAME=$ID; fi
echo "'$ID' : ('$NAME', '$ID@eclipse.org')," >>author.py
done
# or using LDAP, better email addresses
for ID in $( cat author.ids ); do
ldapsearch -x -b "dc=eclipse,dc=org" -s sub "(uid=$ID)" >tmp.txt
NAME=$ID
EMAIL=$ID
if grep "numEntries: 1\$" tmp.txt >/dev/null; then
NAME=$( grep ^cn: tmp.txt | sed 's/cn: //g' )
#EMAIL=$( grep ^mail: tmp.txt | sed 's/mail: //g' )
fi
echo "'$ID' : ('$NAME', '$EMAIL')," >>author.py
done
# clean the CVS repo of links
find cvsroot -type l|xargs -n 1 rm
# get the cvs2git tool
svn co --username=guest --password="" http://cvs2svn.tigris.org/svn/cvs2svn/trunk cvs2svn-trunk
# run the cvs2git tool
cvs2svn-trunk/cvs2git --options=cvs2git_ui_and_e4.options
# create a git repo
#git init --bare --shared eclipse.platform.ui.git #final repo
git init --shared eclipse.platform.ui #tmp repo
# try the fast import
cd eclipse.platform.ui
cat ../cvs2svn-tmp/git-blob.dat ../cvs2svn-tmp/git-dump.dat | git fast-import
# move the tags into a useful place
python ../cvs2svn-trunk/contrib/git-move-refs.py
# Prune and pack the repo
git prune
git repack -a -d --depth=250 --window=250
git gc --aggressive
git repack -a -d --depth=250 --window=250
# verify the repo - this can take long, so for your first test skip this step.
mkdir compare-tmp
python $(pwd)/cvs2svn-trunk/contrib/verify-cvs2svn.py \
--git $(pwd)/cvsroot/eclipse.platform.ui \
$(pwd)/eclipse.platform.ui \
--tmp=$(pwd)/compare-tmp --diff >compare-log.txt 2>&1 &
# Fixing the Delete only tags:
/bin/bash fix_tags.sh >tag_report.txt
grep ^git tag_report.txt >mv_tags.txt
# examine them
/bin/bash mv_tags.txt
# now examine the repo, hopefully the tags and branches that we care about are in decent shape.
# add a .gitignore at the base of the repo to branches you care about
cd eclipse.platform.ui
#contents:
bin/
target/
*~
*.rej
*.bak
#
#
# All of the stuff below are like extra steps.
#
# add it to a bare repo
git remote bareLocal ssh://e4Build@build.eclipse.org/shared/eclipse/e4/git/cvs/eclipse.platform.ui.git
git push --all bareLocal
git push --tags bareLocal
# copy it as pwebster to my home dir
# put it into a test location
cd /gitroot/e4
git clone -l --mirror $HOME/eclipse.platform.ui.git eclipse.platform.ui.git
# converting a simple map file - this does funky things as it tokenizes the line
while read LINE; do
if (echo $LINE | grep :pserver >/dev/null); then
HDR=$( echo $LINE | cut -f1 -d= )
ID=$( echo $HDR | cut -f2 -d\@ )
TAG=$( echo $LINE | cut -f1 -d, | cut -f2 -d= )
echo "${HDR}=GIT,tag=${TAG},repo=git://git.eclipse.org/gitroot/e4/eclipse.platform.ui.git,path=bundles/$ID" >>new.map
else
echo $LINE >>new.map
fi
done <ui.map
# converting a simple map file with sed
sed 's/^\([^@]*\)@\([^=]*\)=\([^,]*\),.*$/\1@\2=GIT,tag=\3,repo=git:\/\/git.eclipse.org\/gitroot\/e4\/eclipse.platform.ui.git,path=bundles\/\2/g'
# for tests, we use file:///gitroot
# provides default path in bundles, needs to be modified afterwards for tests and examples