user@box:/# lsb_release -a No LSB modules are available. Distributor ID: Ubuntu Description: Ubuntu 10.04.2 LTS Release: 10.04 Codename: lucid
Monthly Archives: October 2012
SVN Revert codebase to a previous revision
- Figure out revision number of old good version
svn log http://svn.domain.com/app/branches/3_3_0 -r {2010-09-15}:{2010-09-20}
- See what code will be reverted
svn merge --dry-run -r 25951:25950 http://svn.domain.com/app/branches/3_3_0
- Perform the revision
svn merge -r 25951:25950 http://svn.domain.com/app/branches/3_3_0
- Commit your change
svn commit -m "Description"
Merge all changes from branch to trunk while leaving merge conflicts up to developers
- This document is assuming you have already checked out & updated trunk.
svn checkout http://server/svn/project/trunk ~/workspaces/project_trunk svn update ~/workspaces/project_trunk
- Check out the branch to merge from
svn checkout http://server/svn/project/branches/0.0.6 ~/workspaces/project_0.0.6
- Figure out the revision the branch began
$ svn log --verbose --stop-on-copy http://server/svn/project/branches/0.0.6 ------------------------------------------------------------------------ r3 | joe | 2010-08-03 12:50:08 -0700 (Tue, 03 Aug 2010) | 1 line Changed paths: A /branches/0.0.6/test A /branches/0.0.6/global Adding dirs for test sprint 1 ------------------------------------------------------------------------ r2 | joe | 2010-08-03 12:49:12 -0700 (Tue, 03 Aug 2010) | 1 line Changed paths: A /branches/0.0.6 (from /trunk:1) Creating branch for test Sprint 1 ------------------------------------------------------------------------
NOTE: The revision where the branch was created ($BCV = 2)
- CD into the trunk you are merging to & get the revision num.
cd /workspaces/project_trunk svn update
This will return a message “At revision XXXXX”
jsmith@PC-JSMITH /workspaces/project_trunk $ svn update At revision 92.
$TV=92
- CD to your trunk which you are merging TO
$ cd /workspaces/project_trunk
- Merge the changes from the branch to the trunk
$ svn merge --accept postpone -r ${BCV}:${TV} http://server/svn/project/branches/0.0.6 --- Merging r2 through r92 into '.': C test-3pom.xml Skipped 'foo.bar' C test-parentpom.xml U test-1srcmainjavacomarrisilibTest.java U test-1srcmainjavacomarrisilibApp.java C test-1pom.xml C test-2pom.xml Summary of conflicts: Text conflicts: 4 Skipped paths: 1
- Generate a report of merge conflicts
cd /workspaces/project_trunk find . -type f -name "*.working"
EX:
jsmith@PC-JSMITH /workspaces/project_trunk/trunk $ find . -type f -name "*.working" ./test-1/pom.xml.working ./test-2/pom.xml.working ./test-3/pom.xml.working ./test-parent/pom.xml.working
Copy this list into an email & remove working from the end of each line.
- Get rid of all conflict resolution files
find . -type f -name "*.working" -exec rm {} ; find . -type f -name "*-left.r*" -exec rm {} ; find . -type f -name "*-left.l*" -exec rm {} ;
- Commit your changes
svn commit -m "EM-300 - Merge project 0.0.6 to trunk"
- Send email to DEV team to handle merge conflicts
SVN – Get revision on which branch was created
svn log --verbose --stop-on-copy http://${REPOSITORY}/branches
SVN – Difference between 2 tags
svn diff --summarize http://${REPOSITORY}/tags/${tag_name} http://${REPOSITORY}/tags/${tag_name_2}
SVN – Difference between 2 tags
svn diff --summarize http://${REPOSITORY}/svn/online/tags/build/${BUILD_NUM} http://${REPOSITORY}/svn/online/tags/build/${BUILD_NUM}
SVN – Diff between 2 revision numbers of repository
cd ~/workspaces/foo_repo/trunk svn log -r ${num1}:${num2}
SVN Diff between 2 dates in a local working repository
svn log ${url} -r {2006-08-09}:{2006-08-17}
SVN Access – svn_access_file
Edit your svn_access_file
This example is for a repo called foo.
[groups] admin = jsmith foo_mgt = dapeople foo_dev = gwashington, bclinton, rreagon foo_qa = rnixon, alincoln everyone = @foo_mgt, @foo_dev, @foo_ga ... # # Establish Repository Access by Group. # [foo:/] @admin = rw @foo_dev = r @foo_qa = r [foo:/branches] @admin = rw @foo_dev = rw @foo_qa = rw @everyone = r [foo:/tags] @admin = rw @foo_dev = rw @foo_qa = rw @everyone = r
SVN – Show details of a specific version
$ svn log -vr 784 ------------------------------------------------------------------------ r784 | who | 2011-01-25 18:47:49 -0800 (Tue, 25 Jan 2011) | 1 line Changed paths: M /branches/app-1_0/app1/.classpath R /branches/app-1_0/app1/pom.xml D /branches/app-1_0/app1/src/main/java/com/rest/response/elements A /branches/app-1_0/app1/src/main/webapp/schema/binding.xjb App-1 -> modify some files & delete the elements dir.. ------------------------------------------------------------------------