<?xml version="1.0" encoding="utf-8"?>
<rss xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:wfw="http://wellformedweb.org/CommentAPI/" xmlns:trackback="http://madskills.com/public/xml/rss/module/trackback/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:slash="http://purl.org/rss/1.0/modules/slash/" xmlns:pingback="http://madskills.com/public/xml/rss/module/pingback/" version="2.0">
  <channel>
    <title>Paul Mrozowski's Blog - Source Control</title>
    <link>http://www.rcs-solutions.com/blog/</link>
    <description>A day in the life (of a developer)</description>
    <language>en-us</language>
    <copyright>Paul Mrozowski / RCS Solutions, Inc.</copyright>
    <lastBuildDate>Wed, 07 Nov 2007 03:05:26 GMT</lastBuildDate>
    <generator>newtelligence dasBlog 2.0.7226.0</generator>
    <managingEditor>paulm@rcs-solutions.com</managingEditor>
    <webMaster>paulm@rcs-solutions.com</webMaster>
    <item>
      <trackback:ping>http://www.rcs-solutions.com/blog/Trackback.aspx?guid=4101fe6d-1986-4803-b6c3-5fdea6053965</trackback:ping>
      <pingback:server>http://www.rcs-solutions.com/blog/pingback.aspx</pingback:server>
      <pingback:target>http://www.rcs-solutions.com/blog/PermaLink,guid,4101fe6d-1986-4803-b6c3-5fdea6053965.aspx</pingback:target>
      <dc:creator>Paul Mrozowski</dc:creator>
      <wfw:comment>http://www.rcs-solutions.com/blog/CommentView,guid,4101fe6d-1986-4803-b6c3-5fdea6053965.aspx</wfw:comment>
      <wfw:commentRss>http://www.rcs-solutions.com/blog/SyndicationService.asmx/GetEntryCommentsRss?guid=4101fe6d-1986-4803-b6c3-5fdea6053965</wfw:commentRss>
      <body xmlns="http://www.w3.org/1999/xhtml">
        <p>
I've been using <a href="http://subversion.tigris.org">Subversion</a> along with <a href="http://tortoisesvn.tigris.org">TortoiseSVN</a> (and <a href="http://www.visualsvn.com">VisualSVN</a> inside
of Visual Studio) for a few months now. It's been relatively painless, up until recently
when I've attempted to really start using it for more than the standard "make changes,
check it in". Unlike Visual SourceSafe where you check out a file and it gets locked
until you check it back in (which is just the default; it can actually be changed
to allow shared checkouts), Subversion lets everyone use all the files all the time,
then merge on check in. I haven't attempted to try Subversion with any of my VFP projects
yet, it's been strictly the .NET applications, so I haven't had to try to deal with
merging the binary files created by VFP (eg. for forms, the SCX and SCT files, or
for classes the VCX &amp; VCT files). If you're enterprising, you can try out <a href="http://www.foxpert.com/downloads.htm">TwoFox</a> from
Christof Wollenhaupt. I'm leaving that hill for another day.
</p>
        <p>
I ended up moving around my repository to support the more standard folder structure,
since I didn't do this when I first started out. So my folders are now in this format:
</p>
        <p>
branches<br />
tags<br />
trunk<br />
  |--Project A<br />
  |--Project B
</p>
        <p>
The other suggested route was to put the branches/tags/trunk folder inside the project
folders themselves, ex.<br /></p>
        <p>
Project A<br />
  |--branches<br />
  |--tags<br />
  |--trunk
</p>
        <p>
This looked a little too confusing, especially since most of our projects are build
into a single solution. To move everything around, I opened TortoiseSVN and went into
the repository (right-click in Explorer, select Repo-Browser). Then I navigated to
where I had my .NET development stuff, \Server\DotNetDev, right-clicked and selected
Create Folder. I created the branches folder (which is meant, strangely enough, for
any branches in the source code), then created the tags folder (this is equivalent
to a label in VSS, although Subversion doesn't make a distinction between a branch
and a tag), then the trunk folder (which is meant to hold the primary set of source
code). 
</p>
        <p>
Then I dropped down to a command prompt and moved everything from it's original location
to it's new location:
</p>
        <p>
          <font face="Courier New">svn move -m "Relocating Project" svn://Server/DotNetDev/Project
svn://Server/DotNetDev/trunk/Project</font>
        </p>
        <p>
I kept the Repo-Browser open and hit F5 to make sure the change took place (it did,
so far, so good). The rest of this didn't go so smoothly.
</p>
        <p>
I needed to point my local copy of the source to the new repository location. It turns
out there are two different options to do something like this: Relocate and Switch.
I thought I might want Relocate, so inside of TortoiseSVN I right-clicked on my DotNetDev
folder and selected TortoiseSVN &gt; Relocate. Here are my notes of how this went:
</p>
        <p>
- Immediately see scary message about me doing this, did some Googling, decided I
really DO want to relocate.<br />
- Get another error about it not being the root. Decided to try Switch instead.<br />
- Get another error about one of my projects not being in the same repository.<br />
- Realize I may have mistyped the new repo. name, try svn://Server/DotNetDev 
to svn://Server/DotNetDev/trunk instead.<br />
- Get errors about it not existing in that location for that revision.<br />
- Great.<br />
- Select the option to Update to Revision.<br />
- Suddenly panic that I'm going to lose my changes that haven't been checked into
source control yet. Wish I had thought to make a backup first.<br />
- It doesn't seem to help.<br />
- Realize I had one folder which still pointed to it's original source on the web
(I'm using an open-source project that I had grabbed via TortoiseSVN, so it's still
pointing to that website)<br />
- Try to relocate it and get errors about relocating only changing the repository
part of a URL (regardless of what I try to change)<br />
- Get irritated and go to lunch.<br />
- Get back from lunch.<br />
- Delete the .svn folder that was pointing to the wrong server (the open source one).<br />
- Make a backup of the directory where the .svn folder was.<br />
- Get new version via SVN checkout for that specific folder.<br />
- Try to use Switch.<br />
- Get error about needing to cleanup the project.<br />
- Cleanup.<br />
- Try to use Switch again.<br />
- Get a different error about some file not being able to be added to the repository
because it already exists (it's the same folder I've been having problems with).<br />
- Erase the entire folder including the .svn folder this time.<br />
- Do a checkout on this folder again.<br />
- Finally get around to making a backup of all my files, just in case.<br />
- Try Switch again, it seems to do something and not give any errors.<br />
- Ran a diff on the folder I had problems with to check to see if I lost anything
and/or grab files from my backup.<br />
- Fire up VS and force a rebuild to see what/if anything was broken.<br />
- All good (!)
</p>
        <p>
Relocate = Source is switched to a completely different server.<br />
Switch = Source is on the same server in a different directory.
</p>
        <p>
I'm not entirely sure why these are two different options. 
</p>
        <p>
Fast forward two weeks. I decide to test out the idea of creating a private branch
where I can make all my daily changes (and do a check in at the end of the day). I
basically don't want to check in stuff that isn't complete, may break things for other
developers, etc. But I want to make sure it gets checked in daily so it's backed up.
Branching seemed like a good way of handling this. The initial branch seemed to go
smoothly so I made changes over the next week or so and kept checking them in. Today
I decided to merge the branch back into the trunk so we could get a good copy of the
files on another dev. machine. It seemed to go about as well as moving the repository
(I'll spare you all the ugly details).<br /></p>
        <p>
Ultimately, I think the problems were related to the fact that I had a completely
different mental model of how merging a branch should work: I though you would just
select the option to merge, then select the branch you want to merge from (my local
copy) and select the branch you want to merge to (the trunk), let it merge and resolve
any conflicts (if any). The UI even looks like this is how it should work. It doesn't.
</p>
        <p>
I must have tried merging 20 different times, each time with different errors or issues.
I read and re-read the docs and just didn't seem to understand how this was supposed
to work. Here's what finally worked for me:
</p>
        <p>
I had to check in all of my changes into the branch I had been working with, then
use "Switch" to switch back to the trunk copy (which does some scary things like delete
source code in your local copy). Once I had a copy of the trunk, I did the Merge again,
pointed the "From" option in TortoiseSVN to the trunk, not my local copy. Pointed
the "To" to the branched copy I had been working on. Then I selected the last revision
before the branch in the trunk and all of the revisions in my branch, and it seemed
to merge OK. Then I committed my local copy back into the trunk.
</p>
        <p>
It appears you need to track the revision numbers manually (the check-in notes are
probably the simplest) when merging branches back in; so, for example, if I had revisions
50-55 in a branch which I then merge into the main trunk, then make changes 56-60
in the branch again, I have to make sure I only merge revisions 56-60 into the trunk.
Otherwise, I risk duplicating changes (essentially, Subversion doesn't track your
merges). I looked at the roadmap and it appears that functionality is scheduled for
build 1.5 (it's currently at build 1.4.5). That's definitely going to be a welcome
enhancement.
</p>
        <p>
One thing I noticed in the docs is that they mention that new Subversion users have
problems with the From/To issue, and with picking the correct revision to merge against.
It's pretty clear they're forcing users to deal with implementation details that I
think should be hidden, so that the mental model most of us have of all this actually
matches what we need to do in the UI to accomplish things. Having to mention that
most developers make mistake "X" or "Y" should be a red flag that maybe things need
to be changed.
</p>
        <p>
The one saving grace of all this is that I haven't lost any changes yet. I'm starting
to get in the habit of checking all my files in before I attempt to do anything out
of the ordinary (which seems to be a good practice to get into).
</p>
        <p>
 
</p>
        <p>
          <strong>Links</strong>
        </p>
        <p>
          <a href="http://subversion.tigris.org">http://subversion.tigris.org</a>
          <br />
          <a title="http://tortoisesvn.tigris.org" href="http://tortoisesvn.tigris.org">http://tortoisesvn.tigris.org</a>
          <br />
          <a href="http://www.visualsvn.com">http://www.visualsvn.com</a>
          <br />
          <a title="http://www.foxpert.com/downloads.htm" href="http://www.foxpert.com/downloads.htm">http://www.foxpert.com/downloads.htm</a>
        </p>
        <img width="0" height="0" src="http://www.rcs-solutions.com/blog/aggbug.ashx?id=4101fe6d-1986-4803-b6c3-5fdea6053965" />
      </body>
      <title>Subversion and TortoiseSVN</title>
      <guid isPermaLink="false">http://www.rcs-solutions.com/blog/PermaLink,guid,4101fe6d-1986-4803-b6c3-5fdea6053965.aspx</guid>
      <link>http://www.rcs-solutions.com/blog/2007/11/07/SubversionAndTortoiseSVN.aspx</link>
      <pubDate>Wed, 07 Nov 2007 03:05:26 GMT</pubDate>
      <description>&lt;p&gt;
I've been using &lt;a href="http://subversion.tigris.org"&gt;Subversion&lt;/a&gt; along with &lt;a href="http://tortoisesvn.tigris.org"&gt;TortoiseSVN&lt;/a&gt; (and &lt;a href="http://www.visualsvn.com"&gt;VisualSVN&lt;/a&gt; inside
of Visual Studio) for a few months now. It's been relatively painless, up until recently
when I've attempted to really start using it for more than the standard "make changes,
check it in". Unlike Visual SourceSafe where you check out a file and it gets locked
until you check it back in (which is just the default; it can actually be changed
to allow shared checkouts), Subversion lets everyone use all the files all the time,
then merge on check in. I haven't attempted to try Subversion with any of my VFP projects
yet, it's been strictly the .NET applications, so I haven't had to try to deal with
merging the binary files created by VFP (eg. for forms, the SCX and SCT files, or
for classes the VCX &amp;amp; VCT files). If you're enterprising, you can try out &lt;a href="http://www.foxpert.com/downloads.htm"&gt;TwoFox&lt;/a&gt; from
Christof Wollenhaupt. I'm leaving that hill for another day.
&lt;/p&gt;
&lt;p&gt;
I ended up moving around my repository to support the more standard folder structure,
since I didn't do this when I first started out. So my folders are now in this format:
&lt;/p&gt;
&lt;p&gt;
branches&lt;br&gt;
tags&lt;br&gt;
trunk&lt;br&gt;
&amp;nbsp; |--Project A&lt;br&gt;
&amp;nbsp; |--Project B
&lt;/p&gt;
&lt;p&gt;
The other suggested route was to put the branches/tags/trunk folder inside the project
folders themselves, ex.&lt;br&gt;
&lt;/p&gt;
&lt;p&gt;
Project A&lt;br&gt;
&amp;nbsp; |--branches&lt;br&gt;
&amp;nbsp; |--tags&lt;br&gt;
&amp;nbsp; |--trunk
&lt;/p&gt;
&lt;p&gt;
This looked a little too confusing, especially since most of our projects are build
into a single solution. To move everything around, I opened TortoiseSVN and went into
the repository (right-click in Explorer, select Repo-Browser). Then I navigated to
where I had my .NET development stuff, \Server\DotNetDev, right-clicked and selected
Create Folder. I created the branches folder (which is meant, strangely enough, for
any branches in the source code), then created the tags folder (this is equivalent
to a label in VSS, although Subversion doesn't make a distinction between a branch
and a tag), then the trunk folder (which is meant to hold the primary set of source
code). 
&lt;/p&gt;
&lt;p&gt;
Then I dropped down to a command prompt and moved everything from it's original location
to it's new location:
&lt;/p&gt;
&lt;p&gt;
&lt;font face="Courier New"&gt;svn move -m "Relocating Project" svn://Server/DotNetDev/Project
svn://Server/DotNetDev/trunk/Project&lt;/font&gt;
&lt;/p&gt;
&lt;p&gt;
I kept the Repo-Browser open and hit F5 to make sure the change took place (it did,
so far, so good). The rest of this didn't go so smoothly.
&lt;/p&gt;
&lt;p&gt;
I needed to point my local copy of the source to the new repository location. It turns
out there are two different options to do something like this: Relocate and Switch.
I thought I might want Relocate, so inside of TortoiseSVN I right-clicked on my DotNetDev
folder and selected TortoiseSVN &amp;gt; Relocate. Here are my notes of how this went:
&lt;/p&gt;
&lt;p&gt;
- Immediately see scary message about me doing this, did some Googling, decided I
really DO want to relocate.&lt;br&gt;
- Get another error about it not being the root. Decided to try Switch instead.&lt;br&gt;
- Get another error about one of my projects not being in the same repository.&lt;br&gt;
- Realize I may have mistyped the new repo. name, try svn://Server/DotNetDev&amp;nbsp;
to svn://Server/DotNetDev/trunk instead.&lt;br&gt;
- Get errors about it not existing in that location for that revision.&lt;br&gt;
- Great.&lt;br&gt;
- Select the option to Update to Revision.&lt;br&gt;
- Suddenly panic that I'm going to lose my changes that haven't been checked into
source control yet. Wish I had thought to make a backup first.&lt;br&gt;
- It doesn't seem to help.&lt;br&gt;
- Realize I had one folder which still pointed to it's original source on the web
(I'm using an open-source project that I had grabbed via TortoiseSVN, so it's still
pointing to that website)&lt;br&gt;
- Try to relocate it and get errors about relocating only changing the repository
part of a URL (regardless of what I try to change)&lt;br&gt;
- Get irritated and go to lunch.&lt;br&gt;
- Get back from lunch.&lt;br&gt;
- Delete the .svn folder that was pointing to the wrong server (the open source one).&lt;br&gt;
- Make a backup of the directory where the .svn folder was.&lt;br&gt;
- Get new version via SVN checkout for that specific folder.&lt;br&gt;
- Try to use Switch.&lt;br&gt;
- Get error about needing to cleanup the project.&lt;br&gt;
- Cleanup.&lt;br&gt;
- Try to use Switch again.&lt;br&gt;
- Get a different error about some file not being able to be added to the repository
because it already exists (it's the same folder I've been having problems with).&lt;br&gt;
- Erase the entire folder including the .svn folder this time.&lt;br&gt;
- Do a checkout on this folder again.&lt;br&gt;
- Finally get around to making a backup of all my files, just in case.&lt;br&gt;
- Try Switch again, it seems to do something and not give any errors.&lt;br&gt;
- Ran a diff on the folder I had problems with to check to see if I lost anything
and/or grab files from my backup.&lt;br&gt;
- Fire up VS and force a rebuild to see what/if anything was broken.&lt;br&gt;
- All good (!)
&lt;/p&gt;
&lt;p&gt;
Relocate = Source is switched to a completely different server.&lt;br&gt;
Switch = Source is on the same server in a different directory.
&lt;/p&gt;
&lt;p&gt;
I'm not entirely sure why these are two different options. 
&lt;/p&gt;
&lt;p&gt;
Fast forward two weeks. I decide to test out the idea of creating a private branch
where I can make all my daily changes (and do a check in at the end of the day). I
basically don't want to check in stuff that isn't complete, may break things for other
developers, etc. But I want to make sure it gets checked in daily so it's backed up.
Branching seemed like a good way of handling this. The initial branch seemed to go
smoothly so I made changes over the next week or so and kept checking them in. Today
I decided to merge the branch back into the trunk so we could get a good copy of the
files on another dev. machine. It seemed to go about as well as moving the repository
(I'll spare you all the ugly details).&lt;br&gt;
&lt;/p&gt;
&lt;p&gt;
Ultimately, I think the problems were related to the fact that I had a completely
different mental model of how merging a branch should work: I though you would just
select the option to merge, then select the branch you want to merge from (my local
copy) and select the branch you want to merge to (the trunk), let it merge and resolve
any conflicts (if any). The UI even looks like this is how it should work. It doesn't.
&lt;/p&gt;
&lt;p&gt;
I must have tried merging 20 different times, each time with different errors or issues.
I read and re-read the docs and just didn't seem to understand how this was supposed
to work. Here's what finally worked for me:
&lt;/p&gt;
&lt;p&gt;
I had to check in all of my changes into the branch I had been working with, then
use "Switch" to switch back to the trunk copy (which does some scary things like delete
source code in your local copy). Once I had a copy of the trunk, I did the Merge again,
pointed the "From" option in TortoiseSVN to the trunk, not my local copy. Pointed
the "To" to the branched copy I had been working on. Then I selected the last revision
before the branch in the trunk and all of the revisions in my branch, and it seemed
to merge OK. Then I committed my local copy back into the trunk.
&lt;/p&gt;
&lt;p&gt;
It appears you need to track the revision numbers manually (the check-in notes are
probably the simplest) when merging branches back in; so, for example, if I had revisions
50-55 in a branch which I then merge into the main trunk, then make changes 56-60
in the branch again, I have to make sure I only merge revisions 56-60 into the trunk.
Otherwise, I risk duplicating changes (essentially, Subversion doesn't track your
merges). I looked at the roadmap and it appears that functionality is scheduled for
build 1.5 (it's currently at build 1.4.5). That's definitely going to be a welcome
enhancement.
&lt;/p&gt;
&lt;p&gt;
One thing I noticed in the docs is that they mention that new Subversion users have
problems with the From/To issue, and with picking the correct revision to merge against.
It's pretty clear they're forcing users to deal with implementation details that I
think should be hidden, so that the mental model most of us have of all this actually
matches what we need to do in the UI to accomplish things. Having to mention that
most developers make mistake "X" or "Y" should be a red flag that maybe things need
to be changed.
&lt;/p&gt;
&lt;p&gt;
The one saving grace of all this is that I haven't lost any changes yet. I'm starting
to get in the habit of checking all my files in before I attempt to do anything out
of the ordinary (which seems to be a good practice to get into).
&lt;/p&gt;
&lt;p&gt;
&amp;nbsp;
&lt;/p&gt;
&lt;p&gt;
&lt;strong&gt;Links&lt;/strong&gt;
&lt;/p&gt;
&lt;p&gt;
&lt;a href="http://subversion.tigris.org"&gt;http://subversion.tigris.org&lt;/a&gt;
&lt;br&gt;
&lt;a title="http://tortoisesvn.tigris.org" href="http://tortoisesvn.tigris.org"&gt;http://tortoisesvn.tigris.org&lt;/a&gt;
&lt;br&gt;
&lt;a href="http://www.visualsvn.com"&gt;http://www.visualsvn.com&lt;/a&gt;
&lt;br&gt;
&lt;a title="http://www.foxpert.com/downloads.htm" href="http://www.foxpert.com/downloads.htm"&gt;http://www.foxpert.com/downloads.htm&lt;/a&gt;
&lt;/p&gt;
&lt;img width="0" height="0" src="http://www.rcs-solutions.com/blog/aggbug.ashx?id=4101fe6d-1986-4803-b6c3-5fdea6053965" /&gt;</description>
      <comments>http://www.rcs-solutions.com/blog/CommentView,guid,4101fe6d-1986-4803-b6c3-5fdea6053965.aspx</comments>
      <category>Source Control</category>
    </item>
  </channel>
</rss>