<2017 March>

On this page...



Member of...

ASP Insiders

MVP Visual Developer ASP/ASP.NET

Enter CodeZone

Blog Categories



Deutsche Resourcen


Sign In

#  Tuesday, 26 April 2005

In the second installation of my SVK article series, I'm taking my Subversion repository offline on my notebook, do some work, reconnect and merge my changes with the central Subversion repository.

To work with SVK, you don't need the Subversion service (svnserve) running. Another bonus is that SVK doesn't create the (dreaded, I might say) .svn folders, which (a) roughly double the disk size of your project, (b) get you into hot water with VS.NET, which is why there is a TortoiseSVN build that names the .svn folders differently. But I digress.

First, we have to create a local copy (the one created in the previous article is directly linked to the remote repository):

svk cp //SharpDevelop/trunk //SharpDevelop/local

This will also prompt you in Notepad for a commit message. Alternatively, you could have passed the commit message as part of the cmd line:

svk cp -m "initial import" //SharpDevelop/trunk //SharpDevelop/local

Now, check out the local branch to a directory on disk (note: this directory will be auto-created).

svk checkout //SharpDevelop/local c:\workingcopy

You will be positively surprised how fast this is. And there are no .svn directories in sight. So let's change a file and commit it back to our local repository:

svk commit -m "v2.06 note" readme.txt

This file is only changed in the local repository, not the remote one. But this is the intention of working offline (during travel, at home, you name it).

How do we get the changes back into the central repository? First, sync the trunk with the remote repository:

svk sync //SharpDevelop/trunk

If you have multiple repositories on your computer that you want to sync in one go, use:

svk sync -a

So, let's see if our changes conflict with changes in the central repository:

svk smerge -C //SharpDevelop/local //SharpDevelop/trunk
Auto-merging (0, 1900) /SharpDevelop/local to /SharpDevelop/trunk (base /SharpDevelop/trunk:1897).
Checking locally against mirror source svn://glumpatweri.emailgwiax.com/Fidalgo/trunk.
U   SharpDevelop/setup/readme.txt
New merge ticket: 4c8874e7-0e9e-2041-95c6-598e77699a82:/SharpDevelop/local:1900

If there are no problems (as is the case here), go ahead and perform the merge:

svk smerge //SharpDevelop/local //SharpDevelop/trunk

You are again prompted for the commit message, however, this time remember this is for the total of your changes (unless you use -I). Depending on your Subversion setup, you will be prompted to provide a password:

Password for 'Administrator':

Well, most likely you are not known by this account in Subversion... simply press Enter, and you will be prompted for a different username. A tad counterintuitive at first, but it works. The change is now in the central repository.

There is one thing left to do - merge the changes from the trunk (which you synced previously) into the local copy:

svk smerge //SharpDevelop/trunk //SharpDevelop/local

And finally update your checked out working directory:

svk up c:\workingcopy

Now that wasn't too bad at all. Especially given the fact that you were working offline from a central repository. Oh, and the procedure is for real: revision 1909 in the #develop repository resulted from me writing this step list.

Categories: Subversion
Tuesday, 26 April 2005 12:57:07 (W. Europe Daylight Time, UTC+02:00)  #    Comments [2]


Thursday, 09 June 2005 21:58:15 (W. Europe Daylight Time, UTC+02:00)
Merging with the command line options -l and -I preserves

a) your log messages
b) your different commits


svk smerge -Il //SharpDevelop/trunk //SharpDevelop/local
Markus Palme
Wednesday, 31 August 2005 18:20:13 (W. Europe Daylight Time, UTC+02:00)
if someone reading this hasn't discovered it yet, 'svk push' does exactly what you'd want it to from a local branch, handling the sync and smerge.
Comments are closed.

© Copyright 2017 Christoph Wille

newtelligence dasBlog 2.3.9074.18820
Subscribe to this weblog's RSS feed with SharpReader, Radio Userland, NewsGator or any other aggregator listening on port 5335 by clicking this button.   RSS 2.0|Atom 1.0  Send mail to the author(s)

Don't contact us via this (fleischfalle@alphasierrapapa.com) email address.