Toad World® Forums

When adding a new script to a VCS, where do I save it for the first time?


#1

We’re working on piloting TOAD Team Coding and Version Control and I’m a little confused about adding a new script to version control

According to the TOAD document TeamCoding_GettingStarted.pdf, scripts are not controlled by Team Coding but are controlled manually by the user. But in order to do this, “Files must be saved before these options are enabled.”

Does this mean that I can save it anywhere and then discard it after its loaded to the VCS? Or do I need to be saving it to the proper location in my local repository?

My Version Control Server (as displayed in Team Coding Manager)

Microsoft Team Foundation Server(Pilot)

BanTest_Master

    Documents

    Scripts

        script1.sql

        script2.sql

                   <-- I want the VCS to store the new script in the Scripts folder

My PC’s Local Repository (linked to the VCS)

C:/Repositories

BanTest_Local

    Documents

    Scripts

        script1.sql

        script2.sql

                  <-- Should I save it to this corresponding folder in my local repository

                      and then add it to the VCS, or do I save it somewhere else and

                      wait for TOAD to copy it here when I click Add To VCS?

#2

Update: FWIW, I’ve been experimenting and the following seems to be working.

Note: I’m piloting TFS TFVC, Microsoft’s Team Foundation Services - Team Foundation Version Control. I think you would have to do this differently using Git.

TFVC allows the use of folders within a repository so I created a folder path on the server ending in a folder called Scripts. Then I created a matching folder path on the PC and used a “TFS Workspace” to sync the repository folder path to the corresponding local PC folder path. When I create a new script I save it to the Scripts folder on the local PC. Then when “Add file to VCS” is clicked, TOAD appears to understand the folder structure and automatically copies the script to the correct location in the repository.


#3

Hey Douglas,

Sorry it took me a bit to get back to you! I’ve been dealing with a few other issues. You mentioned in your original post:

Does this mean that I can save it anywhere and then discard it after its loaded to the VCS? Or do I need to be saving it to the proper location in my local repository?

Saving your scripts to the local folder which corresponds to the server is a much better thing to do. Toad can attempt to copy the file to the correct folder if it’s saved elsewhere; however, that can easily cause confusion as you work with your scripts. Saving them to the proper folder helps to alleviate any potential confusion between where you store your scripts locally and where they exist up on the VCS server.

used a “TFS Workspace” to sync the repository folder path to the corresponding local PC folder path

This is something that’s specific to TFS and Perforce. Both products use “workspaces” to link server paths to local ones. In your example, if you prefer, you could simply create a link between “$/BanTest_Master” and “c:\Repositories\BanTest_Local” and TFS should be able to automatically resolve any folder structure underneath that.

TOAD appears to understand the folder structure and automatically copies the script to the correct location in the repository.

Yep, Team Coding will automatically attempt to resolve script locations whenever possible; and the best way to help it is by saving the scripts in their corresponding local folder as you discovered. If Team Coding is unable to resolve the folder automatically, it will prompt you to select a VCS project and use the local folder that corresponds to that project.

This process behaves similarly for Git.

-John


#4

Thanks John! its good to get this clarified. Its working much better now.