Branching is something that is necessary when working on Projects of any real size. We take a copy of the source code from the trunk, creating a branch to work on. The trunk can still be updated and released where necessary and the branch source code is developed in isolation for a period of time, depending on the length of the project.
We wanted to reduce the amount of time it takes to branch projects and also merge the work between the trunk and branches, so to do this we have branched at a higher level. For the Survey Setup project we now have 3 branches, and only 2 workspace mappings required.
The image below shows the 3 branched folders and also a main folder under the Team Project where our solution file is located.
Using multiple Workspaces is something new to us with the Survey Setup project in 2016. Prior to this we had one workspace with all our projects mapped into a single Depot folder on our local hard drive. Below is the new folder structure for the depot.
The main folder is my old depot, this is one workspace which has everything mapped into it for example the BC_Website folder and all the other projects. The SurveySetup2016 folder is for a second workspace, this has the solution file for the project, and branched copies of all the code we need.
Why have we used a second workspace?
- It is easier to manage and maintain. When I have worked on projects in the past the branched code and remained in my main depot for years afterwards, this approach makes it much clearer which workspace mappings you can delete at the end of the project
- Workspaces isolate code changes between them, so I can do some work in the Main Workspace, then switch to working on the Survey Setup project and the Pending Changes are kept separately. You also do a Get Latest for a Workspace, so you can keep your main workspace up to date but leave your Survey Setup workspace, maybe I’m a day into a big change and don’t want to merge changes in yet
- Note: Get Latest is for one Workspace. If you are publishing a site to staging for example make sure you get latest on the correct workspace or you'll not be publishing the latest version as you intended.
- There are limits to how many files can be handled in a Workspace. Some of our users started getting errors from Visual Studio when do a Get Latest. We tracked this down to our Main depot workspace getting too large, so it is good create new workspaces going forward to isolate the work.
Below are two pictures which show you where you switch between Workspace when working in these Windows.
An example of the workspace mappings for Survey Setup are below, it says Active to the left of each mapping here which means it will get the code from these folders on the server and put them in the local folder to the right.
Cloaking
As we are branching at a higher level now it is possible we are bringing down additional source code and projects that we don’t actually need to do Survey Setup. To stop this happening we can tell the server we don’t want to download the code from paths to our local disk by adding a cloak, in the workspace mappings.
The below workspace mappings for example will exclude the Public Website from our workspace, which saves us disk space if we don’t need it for this project.
Comments
0 comments
Please sign in to leave a comment.