0

As an experienced SVN user and TFS beginner, I have some questions about the Shelving/Unshelving process. Hopefully some experienced user can help me a bit with them. My intent is to understand how shelving/unshelving works regarding file contents and versionspecs. To do that, I will present some concrete situations.

I have my (remote) workspace mapping updated to versionspec (== svn revision) X, and I do some local changes, and then shelve them.

  • Can I unshelve them in a different, empty workspace mapping (before doing any 'get')?
  • Can I unshelve them in a different workspace mapping, which is pointing to versionspec X-2 (no relevant changes in the code between these to versionspecs)?
  • Can I unshelve them in a different workspace mapping, which is pointing to versionspec X+2 (no relevant changes in the code between these to versionspecs)?
  • Can I unshelve them in a different workspace mapping, which is pointing to a different version spec which has 'relevant changes' in the affected files/lines?
  • Can I unshelve them in a different workspace mapping, pointing to versionspec X+2, without 'relevant changes' at X+2, but with relevant changes that happened at X+1 (imagine, a line that is removed at X+1, but appears again at X+2) ?

What is the expected behaviour in those cases. Would i get any errors/conflicts? Would I encounter any difference if I used a local workspace instead of a server one?

Marda
  • 161
  • 1
  • 11
  • What do you mean a "local workspace instead of a remote one"? You mean a "Local Workspace instead of a Server Workspace"? If so, then no, there are no differences. – Edward Thomson Jul 25 '14 at 14:16
  • Idd, with 'remote workspace' i meant 'server workspace'. Already corrected in the original question. – Marda Jul 25 '14 at 14:56

2 Answers2

0

No, you can't unshelve in any of this situations! Imagine shelve is a way to keep your work saved when you get up of your desk at 18:00 PM at company on friday and put in a drawer... And get back to the table on monday! Because any item is shelved keeping the address on source control. If you want move to another address, you'll unshelved, and move the item later.

egomesbrandao
  • 788
  • 6
  • 16
  • Nobody talked about a different address; same address but different mappings. – Marda Jul 25 '14 at 13:55
  • For that situation you needen't shelve! You will just update your code on your workspace. If you unchecked the option "Preserve pending changes locally", you will need to unshelve and after update the workspace. – egomesbrandao Jul 25 '14 at 14:01
0

There are some terminology issues going on here. A workspace mapping is simply a list of local paths and the server paths that you want to download to them. A workspace mapping is not "empty" before you do a get; a workspace mapping would be empty if and only if you did not have any mappings from server paths to local paths.

  1. Yes. If you set up a new workspace but do not do a get, you can unshelve a shelveset. This will result in you only having the files shelved, and no otehrs.

  2. Yes. If you had some file Foo.cs at version 8, and you unshelve Foo.cs that was changed at version 6, then now you have Foo.cs at version 6 with the shelved changes. Other files that were not in the shelveset will stay at whatever version they were at, shelving and unshelving do not affect them.

  3. See #2.

  4. In general, no. You can use the TFS Power Tools to do an "unshelve /merge".

  5. Yes. Again, this would simply bring your file back to the version that it was shelved at. If there are changes on the server, then you need to do a Get Latest to merge the local (unshelved) changes with the changes on the server. This mimics the workflow if you had never shelved in the first place.

Edward Thomson
  • 74,857
  • 14
  • 158
  • 187
  • Thank you Edward for your contribution. According to your explanation, "shelving" means save a copy of the modified files that i have in my workspace, at a certain version. And unshelve it into a workspace means, obtain these saved copied files and overwrite with them the files that i have in my current workspace, making the overwritten files point to the original revision at which the shelving was done, plus the local changes i had in the moment of shelving. This also means, unshelving on a workspace with local changes is a bad idea, as i will lose those local changes. Is this correct? – Marda Jul 25 '14 at 14:52
  • @Marda TFVC will simply stop you from unshelving files if you also have pending changes. – Edward Thomson Jul 25 '14 at 15:53