Showing posts with label SVN. Show all posts
Showing posts with label SVN. Show all posts

Jan 22, 2014

How to create and apply a patch from an SVN Commit

Posted Jan 22, 2014
In subversion, there are cases that you may want to apply the same commit to another folder. E.g. you have a similar branch of your source code and you have committed the changes in your main branch. For this case, rather than copying your codes manually, you can create a patch from your SVN commit and apply it to another directory using the ff:

Create a patch from your commit, get the difference between two svn commits. Usually it's just your [desired commit #] minus one:
svn diff -r [reference commit]:[desired commit] > [filename]
e.g.
svn diff -r 9714:9715 > 9715.patch


Copy the patch file to the directory you want to apply it and go to that directory in the command line and type:
patch -p0 < [filename]
e.g.
patch -p0 < 9715.patch 

Nov 27, 2012

SVN Revert a file to a Previous Version

Posted Nov 27, 2012
svn merge -c -[revision number] [file]

e.g.
svn merge -c -80 Classes/MyClass.m
80 is the revision number

Or if you want your entire revert your workspace:
svn merge -c -80 .


Jul 28, 2011

XCode and SVN - Unable to load revisions

Posted Jul 28, 2011
Introduction
There's a weird bug happening in XCode when I add a repository (File -> Source Control -> Repositories...).  I tried other credentials and I'm able to get the revisions, but every time I added mine, I just can't access the SVN even if I supplied the correct username and password. It just keeps telling me "Unable to load revisions"

I even tried removing and adding the repository and account details to no avail.  At first I thought my access was blocked turned out that XCode is using the wrong cache to authenticate itself.


The Solution (or rather workaround)
Go to Terminal and type:
svn checkout [svn_server_path] [local_path] --username [username]

E.g.
svn checkout svn://192.168.0.2/data/master/SVN/PROJ1/trunk/sample ./sampletemp --username mvergel

It will then ask for your password. Supply the correct one and continue to check out the contents.

After this process, your XCode repository should now be okay. If it's not, try to restart XCode.