SVN frequently says file is locked by me in another working copy

前端 未结 5 1073
無奈伤痛
無奈伤痛 2021-02-13 12:46

I have an SVN repository (hosted on Dreamhost) with needs-lock set on binary files. It sometimes happen that, while committing files locked and modified by me, the commit fails

相关标签:
5条回答
  • 2021-02-13 13:24

    If using a JetBrains IDE:

    right click on the file you want to unlock, go to Subversion and click lock

    then select checkbox steal existing lock and apply with OK

    right click on that file again, go to Subversion and click unlock

    If using command line:

    lock the file with --force

    svn lock --force path/to/file.ext
    

    and unlock it again

    svn unlock path/to/file.ext
    
    0 讨论(0)
  • 2021-02-13 13:30

    I also encountered the same problem and found that out of three machines, in one of the machine I have locked the file and due to which I also facing the problem. What I did is release the lock from that machine and proceed further.

    OR

    Steal the lock first and then start working as this is the best option provided by SVN.

    0 讨论(0)
  • 2021-02-13 13:31

    Found this: https://groups.google.com/forum/#!topic/subversion_users/wZikmNEubz4 It seems this problem manifests when using an svn 1.8 client and a server prior to 1.6.17: when updating the root folder of a working copy, my locks get broken (regardless of the needs-lock flag).

    I downgraded to a 1.7.14 client and the problem does not occur.

    0 讨论(0)
  • 2021-02-13 13:35

    Cleanup will not help. That's used for working copy locks, whereas you're running into an issue with files being locked in the repository itself as a means of implementing a mutex between users. See The Three Meanings of "Lock"

    You probably have a client that's locking the file(s) for you in a different working copy without your knowledge (either locally or in a WC on your server), or perhaps you've got a WebDAV share that you've mounted and are opening the file(s) there which is causing a lock to be created.

    0 讨论(0)
  • 2021-02-13 13:47

    On Windows, I fixed the problem by the following steps: 1. Launch Repository Browser by clicking "Repo-browser" in the menu. 2. Locate the locked file. 3. Right click your mouse on the locked file. 4. Click "break lock".

    0 讨论(0)
提交回复
热议问题