Using Multiple Working Copies in VisualSVN

Starting from version 7.1 for Visual Studio 2019 and version 6.5 for Visual Studio 2017, VisualSVN fully supports multiple working copies within a single solution. All working copies show up in the Pending Changes window, where all common operations such as Update and Commit can be performed on them using the context menu. The traffic-light status icons in Solution Explorer and most of the global commands in VisualSVN's main menu respect the multiple working copies too.

If your solution projects span across multiple working copies, various VisualSVN subsystems will behave as described below.

Pending Changes and multiple working copies

The Pending Changes window is a convenient tool to keep track of uncommitted local changes regardless of how complex your solution's layout is. All working copies in your solution now show up in the Pending Changes window as top-level directories, where all common operations such as Update and Commit can be performed on them using the context menu. For example, you can use the Commit context menu command for the root of a working copy to commit its changes.

More advanced commands such as Switch, Branch and Merge are also available via the Pending Changes window. For example, you can use the Switch context menu command for the root of a working copy to switch this working copy to another branch.

Tip
The Pending Changes window shows the working copy that contains the solution file in bold. Commands executed from the main menu will run in the context of this working copy as if it was the only working copy in solution.

Solution Explorer and multiple working copies

The Solution Explorer always shows the traffic-light status of all working copies and their files. The status for the root solution node in Solution Explorer is always cumulative and is shown in the context of the full solution regardless of how many working copies it contains. Cumulative status of your solution is also displayed in the version control status bar.

When executed via Solution Explorer, Context menu commands such as Commit and Update run in the context of the working copy. Executing commands via the root solution node is equivalent to running these commands from the global main menu.

Global main menu command and multiple working copies

VisualSVN commands in main menu are always executed for the root of the working copy in case the solution is contained within a single working copy. When the solution consists of multiple working copies, behavior of main menu commands varies:

  • Update and Show Changes commands execute for all working copies within a solution.
  • Commit command executes for all working copies within a solution. However, VisualSVN 7.1 does not yet support commit operations that affect targets in working copies that belong to different repositories. When trying to commit to such working copies you will receive a special prompt asking to commit changes individually.
  • Show Log, Branch, Switch and Merge commands execute for the working copy that contains the solution file. When your solution file is not under version control, executing these commands from the main menu is not available. You can configure the working copy root manually in case the solution file is unversioned.

File operations tracking and multiple working copies

VisualSVN tracks all file operations performed in Visual Studio and properly reflects them to Subversion. This tracking respects multiple working copies and correctly reflects Visual Studio file operations to Subversion. Moreover, copying or moving a file between working copies that belong to different locations of the same repository reflects properly, too.

Setting working copy root in case of multiple working copies

The VisualSVN | Set Working Copy Root command is used to set relative path between the directory containing the solution file and the working copy.

When there are multiple working copies in the solution, VisualSVN automatically sets the Working Copy root path of the working copy that contains the solution file (.sln). In such case, the Set Working Copy Root command should not be used to hot switch between working copies because the setting is stored in the solution file and will affect other collaborators once the change is committed.

As a workaround, you can use the svn:externals property which is kind of a link to a different path within the same or another repository. The svn:externals property helps you incorporate code and projects from several repositories or different paths within a single repository into a single working copy. For further details please read the Subversion documentation.

See also

KB58: Migrating from AnkhSVN to VisualSVN

Last Modified: