Unshelve confusion over "no pending revisions"

OK I understand what happens during shelving but I'm not so sure I completely understand unshelving.  The docs for "Working with Source Control Shelvesets" say this about unshelving:

"restores each shelved revision into the destination workspace as a pending change as long as the revision does not conflict with a change that was already pending in the workspace."

and

"To unshelve an item, there must be no pending revisions against it in the destination workspace."

I'm still a little fuzzy on what is meant by "does not conflict" and "no pending revisions"   Is that a case of poor wording e.g. change "no pending revisisions" to "no pending changes"   Or is there something meant by "no pending revisions" that I'm just not grokking.  

I think it works this way.  Please tell me if I'm wrong.  To unshelve there can't be any pending operations on the item (edit, delete, rename) otherwise it will just blast over the local workspace item even if the local workspace item is based on a newer version than the shelveset item is based on.  Then if I want I can merge in the changes from the latest version, right


Answer this question

Unshelve confusion over "no pending revisions"

  • Des Geraghty

    Thanks!!!
  • ms_blackhat

    I assume you've seen the PowerToy   http://blogs.msdn.com/buckh/archive/2005/11/16/493401.aspx

    As you noticed, you can't have ANY pending changes on an item you're trying to unshelve.  It would be nice if pending changes that were compatible with each other (e.g. a local rename + an edit in the shelveset) could be overlaid seamlessly, but when we cut Unshelve-Merge we decided to err on the side of safety.  Thus, when Unshelve runs into an existing pending change, nothing is assumed, much less blown away; you simply get an error.

    "Does not conflict" is confusing because ALL pending change types result in the same failure.  I'll look at the RTM docs and make sure it's clearer.

  • Virlene

    OK so one last clarification.  Say my workspace has a version of a shelved item that is many revs newer than the base revision of the item in the shelveset.  However I don't have any pending changes to that item in my workspace.  When I unshelve, the older shelveset item will replace the newer workspace item with no warnings or errors, right   BTW, I do think the docs could be made a bit clearer on this important subject.

    I'm played with tfpt.exe just a bit but I haven't tried its unshelve command yet.  I should play around with it a bit to see what it does.

    Thanks for your help.

  • John Jeffers

    Yes.  When you try to check in, a Version Conflict will be created.  It's exactly the same as if you'd manually done a Get to the old version + Checkout + edited the file + Checkin.
  • Unshelve confusion over "no pending revisions"