Announcement

Collapse
No announcement yet.

can't get client side hook to work

Collapse
X
  • Filter
  • Time
  • Show
Clear All
new posts

  • can't get client side hook to work

    Hi all!

    I'm programming a PLC via CoDeSys 2.5 and use svn to store my code in a debian-side database.
    On Clients there is a tortoise svn on a windows machine installed.

    svn-intern versioning works as it should, but versioning my CoDeSys Code internally is a bit more tricky. I need to be able to "ask" the PLC which version is installed on it.
    To solve this I had the idea to store the svn-version in a file on my client in the repository. From there CoDeSys could store the version in its code.

    For this I'm using a client-side hook (post-commit) , written in powershell:

    [CODE]
    $path = svn info --show-item relative-url

    $newPath = $path.Replace("^", "c:\code")
    $newPath = $newPath.Replace("/" , "\")

    set-location $newPath

    $rev = svn info $newPath --show-item revision

    $fname = "\rev.txt"
    $fobj = New-Item -ItemType File "$newPath\$fname" -force

    $rev | out-file $fobj -append
    svn info $newPath | out-file $fobj -append

    #$wait = read-host

    return 1
    [/CODE]
    The hook itself works, but the version written to my output-file does not match the version in the current directory AFTER the commit.
    I tried using <svn info --show-item xxx> with all existing possibilities for versions, always with same results. What am I doing wrong?

    Please find hook-settings in tortoise attached.

    Many thanks in advance!

    Regards, bootsector2000
    Attached Files

  • #2
    made it!
    check svn info for a specific file, NOT the folder and it works...

    Comment


    • #3
      Excellent - glad you found the answer.

      Comment

      Working...
      X