Skip to content

Instantly share code, notes, and snippets.

@booyaa
Created July 19, 2013 09:13
Show Gist options
  • Save booyaa/6037831 to your computer and use it in GitHub Desktop.
Save booyaa/6037831 to your computer and use it in GitHub Desktop.
TFS as an external tool (hurr) in Oracle SQL Developer

#TFS as an External Tool

hurr

untested and still refers to original example tha used cvs. don't use (yet).

source: https://apex.oracle.com/pls/apex/f?p=43135:28:11686443451696::NO::P28_ID:381

The external script

sqldevtfs.bat:

::This is a windows batch file but conversion to a shell script is trivial. 
::All it does is change directory to the source file directory and issue a commit. 
@echo off

pushd %1

cd

echo cvs commit -m%3 %2

cvs commit -m%3 %2

popd

The external tool definition

  1. Goto Tools > External Tools

If this is the first time you have used the dialog, you will be prompted to set up some automatic definitions.

  1. Click on New and fill in the fields as follows
  • Program Executable:
  • Arguments:${file.dir} ${file.name} "${promptl:label=Checkin comment} "

The quotes round the final parameter are necessary because if can contain spaces. If your pathnames or file names contain spaces, the other parameters will need to be quoted too.

  • Run Directory:
  1. Click Next As of build 2197 there are a couple of error dialogs to click through at this stage. They don't seem to affect the functionality.
  2. File in the display options as appropriate.
  3. Click Next
  4. File in the Integration options as appropriate. I haven't experimented with these, but you should have at least the tools menu selected. You should probably also check the Reload Open Files box.
  5. Click Next
  6. File in the Availability options as appropriate. I have set Enabled to Always for simplicity.
  7. Click Finish

Limitations

  • Only works on one file at a time
  • Only works on FILES, not other object nodes.
  • No access to the database. In the case of PL/SQL files I would like to be able to resubmit them to the database after checkin (so that the checkin comments and version numbers are up to date in the database. The external tools interface doesn't reliably provide connection details to allow this.

Modifications

  • You can replace the commit command with other cvs commands, or you can make the cvs command a prompted parameter.
  • You can replace cvs with another version control tool.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment