| # "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 (as CVS modules from the root) | |
| # you care about in a modules file, ex: | |
| MODULES='org.eclipse.core.commands | |
| ... | |
| 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 | |
| ... | |
| ' | |
| # run the retag script: | |
| ../../scripts/retag_cvs.sh modules_ui.sh R3_6 "06/04/2010 00:00" R3_6_maintenance >tag_pass1.sh | |
| grep ^cvs tag_pass1.sh >tag_fix1.sh | |
| #examine tag_fix1.sh and then run | |
| /bin/bash -x tag_fix1.sh | |
| #re-run retag script | |
| ../../scripts/retag_cvs.sh modules_ui.sh R3_6 "06/04/2010 00:00" R3_6_maintenance >tag_pass2.sh | |
| # Then fix the other tags. TAG1 is a known tag (like from above :-) | |
| ../../scripts/subtag_cvs.sh modules_ui.sh R3_6 R3_6_1 >subtag_pass1.sh | |
| grep ^cvs subtag_pass1.sh >subtag_fix1.sh | |
| #examine subtag_fix1.sh and then run | |
| /bin/bash -x subtag_fix1.sh | |
| #re-run subtag script to verify everybody is tagged | |
| ../../scripts/subtag_cvs.sh modules_ui.sh R3_6 R3_6_1 >subtag_pass2.sh | |
| # | |
| # you have to repeat the above for every tag/branch you care about | |
| # | |
| ../../scripts/subtag_cvs.sh modules_ui.sh R3_6_1 R3_6_2 >subtag_pass3.sh | |
| grep ^cvs subtag_pass3.sh >subtag_fix3.sh | |
| /bin/bash -x subtag_fix3.sh | |
| # do R3_5_maintenance | |
| ../../scripts/retag_cvs.sh modules_ui.sh R3_5 "06/05/2009 00:00" R3_5_maintenance >tag35_pass1.sh | |
| grep ^cvs tag35_pass1.sh >tag35_fix1.sh | |
| /bin/bash -x tag35_fix1.sh >log35_1.txt | |
| ../../scripts/retag_cvs.sh modules_ui.sh R3_5 "06/05/2009 00:00" R3_5_maintenance >tag35_pass2.sh | |
| # R3_5_1, R3_5_2 | |
| ../../scripts/subtag_cvs.sh modules_ui.sh R3_5 R3_5_1 >sub35_pass1.sh | |
| grep ^cvs sub35_pass1.sh >sub35_fix1.sh | |
| /bin/bash -x sub35_fix1.sh | |
| ../../scripts/subtag_cvs.sh modules_ui.sh R3_5_1 R3_5_2 >sub35_pass2.sh | |
| grep ^cvs sub35_pass2.sh >sub35_fix2.sh | |
| /bin/bash -x sub35_fix2.sh | |
| # do R3_4_maintenance | |
| ../../scripts/retag_cvs.sh modules_ui.sh R3_4 "06/11/2008 00:00" R3_4_maintenance >tag34_pass1.sh | |
| grep ^cvs tag34_pass1.sh >tag34_fix1.sh | |
| /bin/bash -x tag34_fix1.sh | |
| ../../scripts/retag_cvs.sh modules_ui.sh R3_4 "06/11/2008 00:00" R3_4_maintenance >tag34_pass2.sh | |
| # do R3_4_1, R3_4_2 | |
| ../../scripts/subtag_cvs.sh modules_ui.sh R3_4 R3_4_1 >sub34_pass1.sh | |
| grep ^cvs sub34_pass1.sh >sub34_fix1.sh | |
| # this says some random parts of org.eclipse.core.databinding.observable already tagged | |
| # W org.eclipse.core.databinding.observable/src/org/eclipse/core/databinding/observable/list/ObservableList.java : R3_4_1 already exists on version 1.12.2.1 : NOT MOVING tag to version 1.12 | |
| # W org.eclipse.core.databinding.observable/src/org/eclipse/core/databinding/observable/map/AbstractObservableMap.java : R3_4_1 already exists on version 1.8.2.1 : NOT MOVING tag to version 1.8 | |
| # W org.eclipse.core.databinding.observable/src/org/eclipse/core/databinding/observable/map/ObservableMap.java : R3_4_1 already exists on version 1.7.4.1 : NOT MOVING tag to version 1.7 | |
| # W org.eclipse.core.databinding.observable/src/org/eclipse/core/databinding/observable/set/ObservableSet.java : R3_4_1 already exists on version 1.6.2.1 : NOT MOVING tag to version 1.6 | |
| # W org.eclipse.core.databinding.observable/src/org/eclipse/core/internal/databinding/observable/UnmodifiableObservableValue.java : R3_4_1 already exists on version 1.2.2.2 : NOT MOVING tag to version 1.2 | |
| /bin/bash -x sub34_fix1.sh | |
| ../../scripts/subtag_cvs.sh modules_ui.sh R3_4_1 R3_4_2 >sub34_pass2.sh | |
| grep ^cvs sub34_pass2.sh >sub34_fix2.sh | |
| /bin/bash -x sub34_fix2.sh | |
| # do R3_3_maintenance | |
| ../../scripts/retag_cvs.sh modules_ui.sh R3_3 "06/14/2007 00:00" R3_3_maintenance >tag33_pass1.sh | |
| grep ^cvs tag33_pass1.sh >tag33_fix1.sh | |
| /bin/bash -x tag33_fix1.sh | |
| # do R3_3_1 and R3_3_2 | |
| ../../scripts/subtag_cvs.sh modules_ui.sh R3_3 R3_3_1 >sub33_pass1.sh | |
| grep ^cvs sub33_pass1.sh >sub33_fix1.sh | |
| /bin/bash -x sub33_fix1.sh | |
| ../../scripts/subtag_cvs.sh modules_ui.sh R3_3_1 R3_3_2 >sub33_pass2.sh | |
| grep ^cvs sub33_pass2.sh >sub33_fix2.sh | |
| /bin/bash -x sub33_fix2.sh | |
| # do R3_2_maintenance | |
| ../../scripts/retag_cvs.sh modules_ui.sh R3_2 "06/06/2006 00:00" R3_2_maintenance >tag32_pass1.sh | |
| grep ^cvs tag32_pass1.sh >tag32_fix1.sh | |
| /bin/bash -x tag32_fix1.sh | |
| # R3_2_1, R3_2_2 | |
| ../../scripts/subtag_cvs.sh modules_ui.sh R3_2 R3_2_1 >sub32_pass1.sh | |
| grep ^cvs sub32_pass1.sh >sub32_fix1.sh | |
| /bin/bash -x sub32_fix1.sh | |
| ../../scripts/subtag_cvs.sh modules_ui.sh R3_2_1 R3_2_2 >sub32_pass2.sh | |
| grep ^cvs sub32_pass2.sh >sub32_fix2.sh | |
| /bin/bash -x sub32_fix2.sh | |
| # do R3_1_maintenance | |
| ../../scripts/retag_cvs.sh modules_ui.sh R3_1 "06/28/2005 00:00" R3_1_maintenance >tag31_pass1.sh | |
| grep ^cvs tag31_pass1.sh >tag31_fix1.sh | |
| /bin/bash -x tag31_fix1.sh | |
| # do R3_1_1, R3_1_2 | |
| ../../scripts/subtag_cvs.sh modules_ui.sh R3_1 R3_1_1 >sub31_pass1.sh | |
| grep ^cvs sub31_pass1.sh >sub31_fix1.sh | |
| /bin/bash -x sub31_fix1.sh | |
| ../../scripts/subtag_cvs.sh modules_ui.sh R3_1_1 R3_1_2 >sub31_pass2.sh | |
| grep ^cvs sub31_pass2.sh >sub31_fix2.sh | |
| /bin/bash -x sub31_fix2.sh | |
| # try R3_0_maintenance :-) | |
| ../../scripts/retag_cvs.sh modules_ui.sh R3_0 "06/25/2004 00:00" R3_0_maintenance >tag30_pass1.sh | |
| grep ^cvs tag30_pass1.sh >tag30_fix1.sh | |
| /bin/bash -x tag30_fix1.sh | |
| # do R3_0_1, R3_0_2 | |
| ../../scripts/subtag_cvs.sh modules_ui.sh R3_0 R3_0_1 >sub30_pass1.sh | |
| grep ^cvs sub30_pass1.sh >sub30_fix1.sh | |
| /bin/bash -x sub30_fix1.sh | |
| ../../scripts/subtag_cvs.sh modules_ui.sh R3_0_1 R3_0_2 >sub30_pass2.sh | |
| grep ^cvs sub30_pass2.sh >sub30_fix2.sh | |
| /bin/bash -x sub30_fix2.sh | |
| # ooops, do R3_7_maintenance | |
| ../../scripts/retag_cvs.sh modules_ui.sh R3_7 "06/24/2011 00:00" R3_7_maintenance >tag37_pass1.sh | |
| grep ^cvs tag37_pass1.sh >tag37_fix1.sh | |
| /bin/bash -x tag37_fix1.sh | |
| # create a local cvs root | |
| # I did this on build.eclipse.org | |
| mkdir cvsroot.eclipse.platform.ui | |
| cd cvsroot.eclipse.platform.ui | |
| 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 | |
| # copy over from modules | |
| . modules_ui.sh | |
| cd /cvsroot/eclipse | |
| for M in $MODULES; do | |
| cp -r $M /shared/eclipse/e4/git/cvs/cvsroot.eclipse.platform.ui/eclipse.platform.ui/bundles | |
| done | |
| # move them into tests or examples, as they're all in bundles. | |
| # clean the CVS repo of links | |
| find cvsroot.eclipse.platform.ui -type l|xargs -n 1 rm | |
| # for this test, I stayed on build.eclipse.org | |
| # can be done on a local machine, if you cp the cvsroot over. | |
| # 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=org.eclipse.migration/eclipse.platform.ui/pass2/cvs2git.options | |
| # create a git 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 & | |
| # we also have to delete at least 2 tags: | |
| git tag -d 'R3_6_api_cleanup_<build_20091125>' | |
| git tag -d 'R3_6_p2_api_cleanup_<20091216>' | |
| # Fixing the Delete only tags: | |
| /bin/bash ../org.eclipse.migration/scripts/fix_tags.sh >../tag_report.sh | |
| grep ^git ../tag_report.sh >../mv_tags.sh | |
| # examine them | |
| /bin/bash ../mv_tags.sh | |
| # now examine the repo, hopefully the tags and branches that we care about are in decent shape. | |
| # In my case, I see Cherrypick markers for a couple of tags. When the conversion is complete and most | |
| # people are happy, a developer will have to examine these commits to see if they | |
| # can be simplified. | |
| Cherrypick tag: R3_0 commit: ec4e21626f848f63af2a079c5f5e161efc8630fa | |
| Cherrypick tag: R3_0_2 commit: ab6a3dacc5785470eaad1a091359123c78b7ea83 | |
| Cherrypick tag: R3_1 commit: 805e3ddc8ae21b1c012bd6cffd0f4473e831e695 | |
| Cherrypick tag: R3_4_1 commit: 6df1509a2002dea97b89c12b67ac2a24dbe0f726 | |
| Cherrypick tag: R3_5 commit: 5d4327c6204d8892eea7dae079391d93bd44c82c | |
| cd .. | |
| git clone --bare eclipse.platform.ui eclipse.platform.ui.git | |
| cd eclipse.platform.ui.git | |
| git remote rm origin | |
| # check that it is shared | |
| git config -l | |
| # the fix if it is not | |
| git config --add core.sharedrepository 1 | |
| # copy it to git root, must be done from pwebster | |
| ssh build.eclipse.org /bin/cp -r /shared/eclipse/e4/git/cvs/eclipse.platform.ui.git /home/data/users/pwebster | |
| ssh dev.eclipse.org /bin/cp -r /home/data/users/pwebster/eclipse.platform.ui.git/* /gitroot/platform/eclipse.platform.ui.git | |
| # now it should be a public test repo: | |
| ssh://pwebster@dev.eclipse.org/gitroot/platform/eclipse.platform.ui.git | |
| # | |
| # | |
| # All of the stuff below are extra steps. | |
| # | |
| # add a .gitignore to branches you care about ... litter git with commits! :-) | |
| cd eclipse.platform.ui | |
| #contents: | |
| bin/ | |
| target/ | |
| *~ | |
| *.rej | |
| *.bak | |
| # try and generate some author data to include in the options file | |
| 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 | |
| # 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 | |
| # 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 | |