Quite often I\'m sitting in the middle of a subversion working copy, and I want to do a quick svn status
to find out what changes I have made since the last che
If you use git-svn as your Subversion client, then you can interact transparently with a Subversion repository using Git commands locally. Git automatically shows you pending across the whole repository when you use commands like git status anywhere in the tree.
Here is my solution, which is a hybrid of various solutions put here. It is written in PowerShell, as I needed it for a PowerShell module I am writing.
<#
This command outputs the top-most parent of the current folder.
If the current folder is not under svn revision control,
it will recurse up one level, and try again.
It stops at the root folder on the current drive.
If the current folder's drive's root folder is not under svn revision control,
it will throw an exception "No SVN Root Directory found."
#>
function Get-SvnRootDirectory {
$currentDirectory = Get-Location
do {
$output = $(svn info $currentDirectory 2> $null)
$output = $output | findstr /C:"Working Copy Root Path:"
if ($LASTEXITCODE -eq 0)
{
break;
}
# if (Test-Path -PathType Container -Path $currentDirectory)
# {
# throw "No SVN Root Directory found."
# }
$currentDirectory = Split-Path -Path $currentDirectory -Parent
if ([string]::IsNullOrWhiteSpace($currentDirectory))
{
throw "No SVN Root Directory found."
}
}
while ($true)
$output -match "Working Copy Root Path: (?<Group>.*)$" | Out-Null
return $Matches.Group
}