What do the various "Update Depth" options in TortoiseSVN mean? - tortoisesvn

We have a large SVN tree, which includes folders which have branches. For each project in the tree I work on, I used to have a separate check out for each branch, as well as one for trunk.
What I'm trying to switch to now, is a single checkout, but with a selective set of folders. I would do this by using the "Update to revision" option, along with "Update Depth" set to "Working copy", and using "Choose items..." to select the folders I wanted. I would then also check "Make depth sticky".
The issue I have is that I can't quite figure out how to tell SVN that I no longer need a particular folder (for instance a branch that is now in production).
I'm trying to understand the "Update to revision" dialog better to see if I'm missing something, and I realized that I don't quite understand what all the options under "Update Depth" mean. I looked though the TortoiseSVN site, and haven't found any good detail.
Can someone explain the differences between the following options under "Update Depth":
Working copy
Fully recursive
Immediate children, including folder
Only file children
Only this item
Exclude
I think I understand "Immediate children", "Only file children", and "Only this item". But I'm not sure what the difference is between "Working copy", "Fully recursive" and "Exclude" is.

Working copy : use the current checkout depth, i.e. don't change anything. If you check more items, those will be checked out fully/recursively.
Fully recursive : that folder is checked out and all subfolders and their subfolders and theirs subfolders... i.e.: everything below that folder is checked out
Exclude : that folder is not checked out and left empty. Neither files nor folders inside that folder is checked out
If you want to remove a checked out folder, right-click on that folder in the working copy, select "Update to revision" from the context menu and set the depth to Exclude

Related

What does not located within the filtered view of the tree mean?

I'm trying to Download a file with Get Revision... and Force Operation on Perforce. The log says that the operation was completed.
p4 sync -f /Folder/.yarnrc#head
1 file updated
But when I switch to the Workspace tree I get the error:
The folder /Folder/.yarnrc is not located within the filtered view of the tree.
The workspace mappings are the same I've used on three other machines and they were fine.
Other sibling files (files inside /Folder) were downloaded correctly
Looks like this is happening only with files that begin their name with a dot.
The "filtered view of the tree" is a P4V thing, not a general Perforce thing (i.e. it's not the same as the View in your client spec). If you look for a little funnel icon on the taskbar that's where the filters are set for the workspace pane -- maybe something is set there that excludes this file? Like a setting to exclude "hidden" files?

Viewing all descendant files in TFS/VS

Is it possible to see all descendant files in the marked folder in the Source Control Explorer window in Visual Studio?
Other source control software I have used have this option, and it makes it very easy to iterate through all the files in a folder recursively and see what has changed.
I think TFS does not support this feature, but there are others options available :
Pending Changes
You don't need to iterate through all the files to see what has changed. You can view easily what has changed using Pending changes. A pending change is a change (Add, Edit, Delete ...) that has not been check-in in TFS. You can view these changes for a single directory or the whole Project. In addition, you can check-in pending changes only for one directory. You will always see the summary window to view all changes before. Right-click the item (Folder or File), and you will see options : Check in, Undo or Shelve. More info here.
File & Folder Comparison
In Source Control Explorer, you can compare the differences between two server folders, two local folders, or a server folder and a local folder. Simply right click on the target folder. It's quite a powerfull feature when you know it.
Read morehere.

How to exclude a folder and not its children from SVN Update in Tortoise SVN

I am working on a shared project which is put in SVN. The directory structure of the project is as follows:
ParentDir
- Child_Dir_1
+ GrandChild_Dir_1
+ GrandChild_Dir_2
- Child_Dir_2
Child_Dir_1 contains configuration files (Eclipse's .LAUNCH files), and people put all sorts of file in this folder.
So each time I update my source code (by right clicking on ParentDir and picking Update), I got a lot of configurations that I don't really need, and I have to delete them manually.
I still need to have the children of Child_Dir_1 (which are GrandChild_Dir_1 and GrandChild_Dir_2) to be updated.
I have tried to go to set the "ignore" property of the of Child_Dir_1 to exclude *.LAUNCH files, but each time I update the source code, the ones that I manually deleted are restored to Child_Dir_1.
Since you are using TortoiseSVN:
Go into Child_Dir_1, select GrandChild_Dir_1 and GrandChild_Dir_2 and right click, TortoiseSVN -> Update.
That will update only those two folders.
Ignore is so that you can "ignore" ( from commit, status etc.) untracked files, files that are not checked in.
It could be that manojlds' answer is the solution for you, but I have doubts. The problem here is that those files are really part of the project. They are kind of unavoidable, and must be in sync with the rest of working copy.
Option 1 (best): Remove all configuration files form repository, or better yet have in repository only configuration template files (with, say, $ as first character in file names). Each user could copy those template files to true configuration files and change them accordingly. Configuration files should not ever be committed. Only template files should, but updating template files will not mess with current configuration files of any user.
Option 2 (second best): Ignore those configuration files. Use your own files for your own configuration, with names that don't clash with existing. You may even add your files to SVN, but you may just as well not add them. Does not matter, as long as you don't need your configuration on another machine.
Option 3: Use ignore-on-commit group. Use those configuration files that already exist. Change them to your likings, but don't ever commit them. To ensure that you don't commit them by accident flag them as non-committable (go to commit window, select all non-committable files, right click > Move to changelist > ignore-on-commit). The problem with this is your files are not protected from other users' updates, but may actually be a good thing.
Option 4: Chop the folder out (a horrible hack). Remove Child_Dir_1 from working copy (Right click on it > Update to revision > set Working depth to Exclude). Save the folder elsewhere first, because it will disappear. After that create it again, inside it checkout all subfolders (GrandChild_Dir_1 and GrandChild_Dir_2), and copy your configuration files. Now you have complete control over folder's contents, but update and commit become more complicated.
Edit: There is option 5 in theory, but I doubt it can be implemented successfully. You can try: Use NTFS hard links. Copy the whole tree with all files as hard links to existing files, except .svn folders and their contents. Original directory is used for SVN operations update, commit, add and delete, and new directory is used for editing files. From new directory delete all the files you don't need, and insert all the files you do need that are not the part of SVN. The problem here is minor extra work when deleting files from and adding them to SVN.

After doing a sparse checkout with the immediate children option, can I retrieve a subfolder's contents in TortoiseSVN?

My repository looks like this:
trunk
doc
src
etc...
I want to grab the entire contents of src and get the other directories as needed in the future.
If I do a sparse checkout of trunk with "Just this item", I can get all of src by going into the Repo-Browser per the TortoiseSVN documentation (under the section "Checkout Depth".
Is there a way to get the entire contents of src at a later time if my sparse checkout is "Immediate children, including folders"?
It just seems a little awkward to me that if you use "immediate children" that you can never lazy load the entire contents of a folder, so I figured there was a way to do it.
You can change the checkout depth by using the "update to revision" command (usually in the TSVN submenu, not in the top explorer context menu).
In that dialog, just select the depth you want, then hit the OK button to run the update.

Using tortoiseSVN, how do you tag the code?

Using TortoiseSVN, how do you tag the code?
Is the process to branch exactly the same?
I know you have to just copy the code to the /tag/ folder, but how?
i.e. I want to copy revision # to a tag#.
Will it affect the /trunk/ at all?
The answers here were missing some key information for getting started with SVN and braches.
Step 1: You need to make sure you have a suitable branches/tags dir. e.g. if your project has this structure:
url/myproj/trunk/...
you also need:
url/myproj/tags/
url/myproj/branches/
To do this, don't "add" the directories and commit them, or tortoise will give you an error. Instead use the tortoise svn repo-browser, go to myproj then right click and "add Folder".
Step 2: Right click on your trunk folder, select "tortoise SVN" then "branch/tag". The copy branch/tag dialogue now pops up.
Step 3: Set the "to Path" to "/myproj/tags/myversion" where myversion is usually something like "1.0". Select "Head revision in the repository" and make sure "switch working to new branch/tag" is not checked. Hit OK.
Step 4: Unfortunately, next time you do an update, it will pull down the branches and tags as files. This means your HD will get filled with every file from every branch and version created. One solution is to only checkout each individual trunk dir, which is not always convenient (as you have to manually update 30 trunk dirs if you have one repo with 30 projects).
Personally, having used CVS, SCCS, PVCS, VSS & Rational for 30 years, I find SVN much harder to work with.
Right click on your project folder and select Branch/Tag
Point the URL to whatever you want the folder to be called inside the /Tag/ folder
Select Specific revision in repository and choose the one you want
It won't affect the trunk at all.
How to create a tag :
Right click on your repository local copy
Choose Create a branch or a tag...
Choose URL of the tag (normally at the same level that trunk you have a tags folder)
Choose which revision you want to tag
(Usually, you will choose HEAD revision. Why ? Because normally tags are to mark a state of your repository typically for release management, and then when you have the repository state wished, you tag it and then continue the development.
Yes, it's almost the same process that for branches, the difference is "conceptual".
No effect to your trunk !
Here's the official documentation.
Creating a tag won't affect the trunk nor your working copy (you'll still be pointing to trunk) unless you switch to the newly created tag or branch.
Answers below:
The process is almost exactly the same as a branch.
A branch is a tag which is updated essentially.
Right click on the folder you want to tag, click on RepoBrowser, then branch/tag.
Modify the ToURL, with where you want to place your tag
Enter your comment/tag in the box below.
This will tag the code in the folder, without moving it.
This will not effect the trunk at all.

Resources