oleksii.sapov-erlinger
oleksii.sapov-erlinger

Reputation: 412

Tag specific set of files inside an svn repository

So far I read about the concept of tagging in svn it looks like you always should create a snapshot of the whole repository or at least of the whole folder. I wonder if it possible to tag only the state of the particular files? For instance, I'd need to save this set of files as v1.0.0:

..\trunk\util\xslt_oxygen\reference_texts\create-IDs.xsl

..\trunk\util\xslt_oxygen\lib\functions_all.xs

but in those folders, there are also a lot of other files, which I am not interested to include in this release. And when later, I'd want to revert to this tag, I don't want to revert other files.

I'm using TortoiseSVN.

Upvotes: 1

Views: 979

Answers (2)

Benjamin W. Bohl
Benjamin W. Bohl

Reputation: 340

I see the need and to some degree I dislike the idea of just copying a bunch of files to a tag folder and potentially loosing their commit history. the svn:copycommand might help and maybe the section on »Creating a Complex Tag« at http://svnbook.red-bean.com/en/1.8/svn.branchmerge.tags.html helps you.

Upvotes: 1

Álvaro González
Álvaro González

Reputation: 146450

A tag in Subversion is nothing but a subdirectory you arbitrarily decide to consider as such and you typically create it by copying another directory from the repository (either from HEAD or from an earlier revision) so you can link it to the source files and have access to the change history.

Nothing prevents you from cherry-picking files. However, since it's a non-standard use case, you cannot use TortoiseSVN's Branch/tag feature because the interface doesn't provide a way to pick individual items. You'll have to do it yourself (either manually, either with a custom script).

I'm honestly not fully sure of the details. Perhaps you can just svn copy both files and use the --parents flag to create intermediate directories. Or you can svn copy the complete directory and then remove the other files. Using TortoiseSVN, you can tweak the working copy to your liking before committing to repo.

So some experimentation may be needed to figure out which options is easier and keeps history record.


Said that, I can't understand the concept. Your description of tag feels more similar to a release, i.e., a set of files you distribute to end users, possibly with compiled binaries and even packed as ZIP. A release is generated from a tag but not stored in the repository.

Upvotes: 0

Related Questions