Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- Imports System
- Imports EnvDTE
- Imports EnvDTE80
- Imports EnvDTE90
- Imports System.Diagnostics
- ' TortoiseSVN integration macros to be put into the VS2008 Toolbar or
- ' into context menus for files
- ' Created 2010 by Oliver Iking
- ' Follow me on twitter: http://www.twitter.com/einWikinger
- ' To embed the macros into your VS toolbar, simply create a new
- ' toolbar and drag the macros from the commands list into it!
- ' Or bind it to a shortcut. Integrate it into context menus. As you like!
- Public Module TortoiseSVNIntegration
- ' Executes a SVN command on the currently selected file (might be the focused file in the editor
- ' or in the project tree, depending on the context)
- Sub DoSVNCommandOnCurrentFile(ByVal command As String)
- If Not (DTE.ActiveDocument Is Nothing) Then
- Dim filename As String = DTE.ActiveDocument.FullName
- Dim commandString = "tortoiseproc /command:" + command + " /path:" + filename
- 'Dim commandLine = "cmd /c """ + commandString + """"
- 'Shell(commandLine, AppWinStyle.NormalFocus, True, 100)
- Dim procid As Integer = Shell(commandString, AppWinStyle.NormalFocus, True, 1000)
- End If
- End Sub
- ' Diffs the current file against the latest revision.
- Sub DiffCurrentFile()
- DoSVNCommandOnCurrentFile("diff")
- End Sub
- ' Shows revision log for current file
- Sub RevLogOfCurrentFile()
- DoSVNCommandOnCurrentFile("log")
- End Sub
- Sub RevertCurrentFile()
- DoSVNCommandOnCurrentFile("revert")
- End Sub
- Sub BlameCurrentFile()
- DoSVNCommandOnCurrentFile("blame")
- End Sub
- Sub CommitCurrentFile()
- DoSVNCommandOnCurrentFile("commit")
- End Sub
- Sub UpdateCurrentFile()
- DoSVNCommandOnCurrentFile("update")
- End Sub
- Sub AddCurrentFile()
- DoSVNCommandOnCurrentFile("add")
- End Sub
- End Module
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement