Welcome to our new forum
All users of the legacy CODESYS Forums, please create a new account at account.codesys.com. But make sure to use the same E-Mail address as in the old Forum. Then your posts will be matched. Close

Commiting project to svn leaves objects locked

ranie
2013-12-18
2013-12-18
  • ranie - 2013-12-18

    Hi,

    I have a problem when trying to commit to SVN using a python script.
    When I do the following:

    proj.svn.commit(r'Updated by build server')
    

    I get an error if I dont set the project infomation object first:

    projInfo = proj.get_project_info()
    projInfo.version = "1.0.0.0"
    

    If I set the project information object, as above, the commit succeeds, but leaves the project information object locked in SVN.
    (Notice that if the project information object is modified compared to the SVN base, then it is commited and left unlocked as it should, but if the project information object does not contain modifications it is left in the locked state, which is a problem since the next time I run the script it will fail)

    I have tried using the unlock method, like ```

    proj.svn.unlock()

    ``` as described in the documentation, but I get an error when using this saying that the unlock method does not exist.

    This means that I cannot commit from python, without the project information object being left in the locked state.

    Any suggestions how to solve this?

    Thank in advance.

     
  • Anonymous - 2013-12-18

    Originally created by: M.Schaber

    Hi,

    First: Which error do you get exactly when trying to commit your project?

    In my tests, I could commit several projects with and without project information objects, and with and without a version information set.

    Second: If there's a real change, the lock gets removed during the commit. Only when the project information object does not have local changes, it gets not unlocked during the commit, as it is not part of the commit.

    Third: You need to issue the unlock() command on the locked object, not the project:

    projInfo.svn.unlock()
    

    HTH,
    Markus

     

Log in to post a comment.