Applies to: VisualSVN 8.6 and later
This article describes the Working Copy Settings step in the Get Solution from Subversion and Add Solution to Subversion wizards in the VisualSVN plug-in for Visual Studio.
In particular, this article describes the purpose of the Store pristine copies locally option.
Store pristine copies locally
If the Store pristine copies locally checkbox is selected (the default), the wizard will create a regular (normal) working copy, which is the type that was always used in Subversion 1.14 and earlier. A regular working copy always stores not only the versioned files, but also pristine copies of all these files' original state, to speed up certain local Subversion's commands.
If the Store pristine copies locally checkbox is cleared, the wizard will create a pristineless working copy, which reduces the size of the working copy by up to 50%. Such a version copy stores the versioned files themselves, but initially does not store their pristine copies. The tradeoff is that this working copy will potentially need extra communication with the repository for certain operations, such as when reverting a local change.
What are pristine copies inside a working copy?
In addition to storing user-editable versioned files, a regular
working copy always stores pristine (i.e. unmodified) copies of all
these files in its hidden administrative .svn directory
alongside other administrative information. This means that a regular
working copy is roughly twice the size of all the versioned files
in it. A file's pristine copy reflects the file's version from the
repository, by comparing against which the file's local pending
working-copy changes can be determined. Such local pristine copies (also
called pristines) allow certain operations in the working copy to
run faster and allow avoiding communication with the repository whenever
possible. For example, they allow Subversion's diff and
revert operations to work offline.
In contrast, a pristineless working copy (Store pristine copies locally cleared) initially does not store any pristines. Instead, the Subversion client will download the pristine of a specific file from the repository only when this specific pristine is needed. For example, when you use the Show Differences command for that file. After that, the pristine of that particular file remains cached in the working copy as long as the file still has uncommitted changes (for example, until the file's local changes are committed or reverted).
Tradeoffs of regular vs. pristineless working copies
Both a regular and a pristineless working copy offer all of the standard Subversion's functionality. However:
- a regular working copy optimizes for reducing communication with the repository, i.e. reducing the network bandwidth used by Subversion's commands.
- a pristineless working copy optimizes for reducing the use of local storage.
Here is how regular and pristineless working copies compare:
| Category | Regular | Pristineless |
|---|---|---|
| Disk space | Regular working copies are more than twice the size of the working tree because each file has a pristine copy | Up to 50% less disk space usage in total because pristines aren't stored by default |
| Showing file differences, including Quick Diff markers in the code editor of Visual Studio | Works offline, no server communication needed | Downloads and keeps the pristine copy of a file when needed |
| Reverting local uncommitted changes | Works offline, no server communication needed | Downloads the pristine copy of a file when needed |
| Committing changes | Sends only the changed parts of modified files | Sends full contents of modified files |
| Updating or switching | Downloads only the missing content from the target revision and path | Downloads missing pristines for locally modified files as well as the missing content from the target revision and path |
A regular working copy is the traditional and time-tested type of Subversion's working copy. Whereas a pristineless working copy is an alternative that is most useful when:
- The working copy of your project is very large. In particular, when it contains a lot of binary assets, such as images, 3D models, video or audio. Or when the working copy contains a lot of files that rarely change. That is, when pristines may occupy a lot of disk space without being frequently needed.
- Your computer has a fast and low-latency connection to the Subversion server. This is typically the case when your computer and the Subversion server are on the same LAN.
Converting between a regular and a pristineless working copy
A regular working copy cannot be converted in-place to a pristineless one (and vice-versa). Instead, you can check out a new separate working copy with the Store pristine copies locally option set as you want. For example, you can check out a new working copy by running VisualSVN | Get Solution from Subversion.
Compatibility with Subversion clients and servers
Compatibility with Subversion clients
A regular working copy (Store pristine copies locally selected) is compatible with TortoiseSVN 1.8 or later and with other clients based on Subversion 1.8 or later.
Using a pristineless working copy (Store pristine copies locally cleared) requires TortoiseSVN 1.15 or later. It also requires VisualSVN 8.6.0 or later for Visual Studio. Older clients will display an error message such as:
Compatibility with Subversion server
Both regular and pristineless working copies are compatible with any version of Subversion servers.