Get Latest or Undo Checkout Didn’t Overwrite File in IDE

A collection of information about Vault, including solutions to common problems.

Moderator: SourceGear

Post Reply
dan
Posts: 2448
Joined: Wed Dec 17, 2003 5:03 pm
Location: SourceGear
Contact:

Get Latest or Undo Checkout Didn’t Overwrite File in IDE

Post by dan » Tue Apr 13, 2004 2:13 pm

By default, Get Latest and Undo Checkout do not overwrite changes made to files. Vault is very careful about not overwriting file content unless the user explicitly asks it to.

If you want the file to be overwritten on Undo Checkout, you can:
  • Set the global default to revert changes on Undo Checkout. From within Visual Studio .Net, go to Tools->Options->Source Control->SCC Provider->Advanced button. This will bring up Vault’s options. In the Local Files Pane, change “On Undo Checkout” to “Revert”.
  • When you invoke Undo Checkout from the IDE and the Undo Checkout dialog is displayed, click the advanced options (in VS.Net, this is the upper left hand icon in the dialog). This will allow you to set the option to revert the file to its previous contents.</UL>
Get Latest is a little more complicated, because you generally don’t want the IDE to overwrite changed files when you do a Get Latest – otherwise, the IDE would regularly overwrite your work. In addition, the Get command dialog will only be displayed when you set an option in the global Vault options to do so, and if you set that option, the Get command dialog will be displayed incessantly (this is a problem within Visual Studio, where it asks Vault to display the dialog far more often than is seemingly necessary).

To overwrite a file on Get, you can:
  • Set the global default to overwrite changes on Get Latest. Again, this is not recommended as the default, but temporarily changing it can be the easiest way to overwrite a specific file. From within Visual Studio.Net, go to Tools->Options->Source Control->SCC Provider->Advanced button. This will bring up Vault’s options. In the Local Files Pane, change “Modified Working File” to “Overwrite”. Be sure to reset this option to “Attempt Automatic Merge” if you don’t want Overwrite to happen on every Get Latest.
  • Set the option to always bring up the Get command dialog, then change the option to overwrite the file. Note that, due to the way Visual Studio calls Vault, the Get command dialog is only displayed when the file has changed on the server, so it is possible that you would invoke Get Latest, and no command dialog would be displayed. So, this option has the annoying effect of coming up lots of times when not needed, and sometimes not at all when it is needed. Such is life when using MCSCCI-based IDE integration. To turn on the Get Latest dialog, go to Tools->Options->Source Control->SCC Provider->Advanced button, and check General->Always display command dialog on Get Latest Version. When the Get command dialog is displayed, set “Modified Local File” to “Overwrite”.
  • Check out the file temporarily, and then undo the checkout, and specify Revert when undoing the checkout. This is obviously a work-around when options are set a certain way, but it is effective. You can also specify overwrite on the checkout (from advanced options in the upper left).

Post Reply