23

I'm working on several repositories at work and would like to be informed, if anything changes in the SVN repositories.

I made a small BAT script (yes, BAT is useful sometimes) that keeps executing an svn log -r BASE:HEAD on my working copy. It shows all submit comments and revision dates. It works really well, but it's not comfortable for different repositories.

How do you keep track of changes in your repositories? Do you use a small program you made for yourself? Do you use software someone else made? I'm interested in every approach to this problem.

I would like to get notifications and more information about the commit. The IDE integrated functions are good, but work only if I request the information.
I don't want to act to get this information.

Platform: Windows, Subversion 1.5 and higher.

Peter Mortensen
  • 30,738
  • 21
  • 105
  • 131
guerda
  • 23,388
  • 27
  • 97
  • 146

7 Answers7

33

I'm using CommitMonitor; it's from one of the TortoiseSVN developers. You can easily add several SVN URLs to monitor and specify an interval to check for commits. If any updates are found, it shows a little popup windows in the corner of the screen.

There is also SVN Monitor, but that is a bit more complicated to use and setup. Besides giving a message on commits, it can also show you which files you have modified and remind you to commit your changes.

Peter Mortensen
  • 30,738
  • 21
  • 105
  • 131
Otherside
  • 2,805
  • 22
  • 21
5

If you have TortoiseSVN installed, then you could use SVN Notifier.

Peter Mortensen
  • 30,738
  • 21
  • 105
  • 131
Edd
  • 3,724
  • 3
  • 26
  • 33
  • How do I start SVN Notifier? Is there an exe? It used to run itself, but I stopped it few days ago. – Danijel Mar 17 '17 at 07:01
2

I have WebSVN installed and subscribe to RSS feeds of the paths I'm interested in.

Peter Mortensen
  • 30,738
  • 21
  • 105
  • 131
David Henderson
  • 1,185
  • 1
  • 10
  • 16
1

Email. An example SVN post-commit hook to send email can be found in subversion itself.

Peter Mortensen
  • 30,738
  • 21
  • 105
  • 131
NUXI
  • 551
  • 3
  • 4
1

I use PowerShell to detect changes on an SVN branch and deploy. This script should be called from Task Scheduler and executed from the SVN root (or you can simply loop and sleep forever):

function get-revision() {
    $rev = svn info 2>&1 | sls '^Last Changed Rev:' | out-string
    $rev = $rev -split ':'
    $rev[1].Trim()
}

function if-changed([string]$branch, [scriptblock]$script) {
    Write-Verbose "Checking for changes: $branch"
    pushd $branch
    $r = get-revision

    if ($r -gt $status[$branch]) {
        Write-Verbose "|- '$branch' changed, revision $r"
        & $script
    }
    else { Write-Verbose "|- '$branch' is up to date at revision $r" }
    $status[$branch] = $r
    popd
}

svn update
Write-Verbose "Getting the deploy status"
if (Test-Path status) { $status = Import-Clixml status } else { Write-Verbose "|- No status found"; $status=@{} }

if-changed trunk { "Deploying trunk..." }

This is far easier and portable than using any of the above mentioned third-party applications.

Peter Mortensen
  • 30,738
  • 21
  • 105
  • 131
majkinetor
  • 8,730
  • 9
  • 54
  • 72
  • What is the method of notification? It is not clear from the PowerShell code. – Peter Mortensen Aug 30 '16 at 11:24
  • How is the user notified? For instance, is a ***new*** command-line window opened containing the notification text? – Peter Mortensen Aug 31 '16 at 08:44
  • You can choose whatever: `if-changed trunk { Send-Mail ... }`. BaloonPopup is another popular choice. – majkinetor Sep 03 '16 at 14:19
  • What actually happens in the sample code as given? Does it very briefly (or not so briefly) display "Deploying trunk..." in something resembling a command line window (black window)? – Peter Mortensen Sep 17 '16 at 15:28
  • If you run this script all the time it will display 'Deploy trunk' in the console. If you don't want to look into the console window you can run it hidden via for example TaskScheduler in which case message wont be seen but you use some other mechanism like BaloonPopup which will then pop up from tray with the message. – majkinetor Sep 17 '16 at 18:17
  • The easiest solution if console is hidden is probably this: `$wshell = New-Object -ComObject Wscript.Shell; $wshell.Popup("Deploy trunk",0,"Done",0x1)` – majkinetor Sep 17 '16 at 18:18
0

svn info | grep Revision works for me. It shows, for example:

Revision: 183

If it's changed from what I think it should, then I investigate further.

wallyk
  • 56,922
  • 16
  • 83
  • 148
0

I use

svn status --show-updates

to show you which files I've changed as well as those files which have changed in the repository.

You could use Subversion's hook scripts to set up notifications.

Peter Mortensen
  • 30,738
  • 21
  • 105
  • 131
Convict
  • 506
  • 2
  • 4