No announcement yet.

Need help understanding Working Copy after switching to a new Branch

  • Filter
  • Time
  • Show
Clear All
new posts

  • Need help understanding Working Copy after switching to a new Branch

    Subversion is new to our team and I am learning it for the purpose of running a demo and teaching basic concepts to developers. So I really am a newbie to SVN. Although I understand the concept of Switching, I am having difficulty with my WC after doing a Switch to a newly created Branch. I am using TortoiseSVN.

    To keep things simple for demo purposes:

    1) I start with an empty project repository called Tutor (trunk, tags, and branches folders (no files)).
    2) Create file a.txt in Trunk, Add and Commit to repository.
    3) Copy Trunk folder to new branch called bug_fix in branches folder from HEAD revision. "Switch working copy to new branch/tag" is checked.
    4) Update WC at project root level.

    This is where I am having trouble understanding how my WC should now look.
    Repository and WC both look like this:

    As I understand Switching, any new commits to repository should now go to the bug_fix branch I created.
    So to commit changes to the /branches/bug_fix folder in repository do I have to make these changes in the new /branches/bug_fix folder in my WC or can I make these changes in the /trunk folder in my WC? Does it matter?
    If I am now switched to /branches/bug_fix, how does the /trunk folder in my WC come into play here?

    When I modified /trunk/a.txt and committed to repository, the change happened only in the /branch/bug_fix folder. It did not happen in the /trunk folder. This is due to switching to the bug_fix branch, this I get.

    I then did an Update of my WC. Now the updates made to file a.txt are in both /trunk and /branches/bug_fix in my WC.

    I then made another change to a.txt, but this time to the version in the /branches/bug_fix folder. Same thing occurred. I did a Commit, and then an Update to my WC, and the changes now appear in both trunk and bug_fix branch version of the file a.txt.

    My guess is being a newbie, I am not understanding the basic fundamentals of Switch here, especially how your WC should look after doing a Switch. It seems I can update the same file in the trunk OR in the branch I have switched to and only the file in the branch is updated in the repository. AND when I do an Update of my WC after committing the file, the file is updated in both the trunk and branch folders. This makes it confusing and hard to follow. Does anyone have a simple way of understanding this? Please help!