Updated: Subversion PowerShell Module

  • 4

Updated: Subversion PowerShell Module

Line Break

Author: Frank Peter (95 Articles)

In May 2014, I published a PowerShell Module in the TechNet Gallery. It has a five star rating after all based on four votes, LOL. Anyways, I revised that module in order to support pipeline processing and whatif. Furthermore, I decided to publish the Subversion module in the PowerShell Gallery

The Subversion Powershell Module provides a bunch of functions and aliases to work with Subversion/SVN working copies. It requires the Subversion command-line binary svn.exe.

  • Update-SvnWorkingCopy brings the latest changes (HEAD revision) from the repository into an existing working copy.
  • Publish-SvnWorkingCopy sends the changes from your working copy to the repository.
  • Import-SvnUnversionedFilePath commits an unversioned file or directory tree into the repository.
  • New-SvnWorkingCopy checks out a working copy from a repository (HEAD revision).
  • Get-SvnWorkingCopy returns the status of working copy files and directories.
  • Add-SvnWorkingCopyItem puts files and directories under version control, that is scheduling them for addition to repository in next commit.
  • Remove-SvnWorkingCopyItem removes files and directories from version control, that is scheduling them for deletion upon the next commit. (Items that have not been committed are immediately removed from the working copy.)
  • Repair-SvnWorkingCopy fixes a working copy that has been modified by non-svn commands in terms of file addition and removal. The function identifies items that are not under version control and items that are missing. It puts non-versioned items under version control, and it removes missing items from version control (i.e. schedule for deletion upon next commit).
  • Switch-SvnWorkingCopy updates the working copy to a different URL within the same repository.

The functions provide only basic functionality and work fine with the subversion command line client from http://www.collab.net/downloads/subversion


4 Comments

Alexander Volkmer

December 29, 2016 at 3:42 pm

Hallo,
ich habe nach einem SVN Powershell Script gesucht und bin hier gelandet.

Dein Script funktioniert leider bei mir nicht mit Dateien mit leer zeichen.
Ich habe im Script Get-SvnWorkingCopy.ps1 den regex ausdruck angepasst, bei läuft es jetzt auch mit Dateinamen mit leer zeichen.

Könntest du das ändern und noch ein copy einbauen.
$SVNEXE = “C:\Program Files\TortoiseSVN\bin\svn.exe”
$SVNcommand = @(“copy”, “svn://dev-sc/abc/trunk”, “svn://dev-sc/abc/tags/BET-$version”, “-m”, “BET-$version”)
&”$SVNEXE” $SVNCommand

Oder kann ich die Dateien anpassen?
Wie kann ich eigentlich angepasste dateien installieren. Hat irgendwie bei mir nicht funktioniert. Habe die Anpassungen dann in allen Dateien auf meinem Rechner gemacht. Gab glaube ich zwei oder drei.
Habe es wie beschrieben installiert: https://gallery.technet.microsoft.com/Subversion-PowerShell-bbd1db40

Danke!

Würde mich über Rückmeldung freuen.

Gruss!

Alexander Volkmer

    Alexander Volkmer

    December 29, 2016 at 3:45 pm

    Regex: {$_ -match ‘^(?\S{1})*\s+(?.+)$’}

    Frank Peter

    January 2, 2017 at 9:59 pm

    Danke ich checke das. Das Modul ist ein public repository in github/fpschultze.

Leave a Reply

*