What should I do when 'svn cleanup' fails?

后端 未结 30 1490
谎友^
谎友^ 2020-12-04 04:50

I have a lot of changes in a working folder, and something screwed up trying to do an update.

Now when I issue an \'svn cleanup\' I get:

>svn clea         


        
相关标签:
30条回答
  • 2020-12-04 05:21

    Read-only locking sometimes happens on network drives with Windows. Try to disconnect and reconnect it again. Then cleanup and update.

    0 讨论(0)
  • 2020-12-04 05:22

    If the issue is case sensitivity (which can be a problem when checking out to a Mac, as well as Windows) and you don't have the option of checking out onto a *nix system, the following should work. Here's the process from the beginning:

    % svn co http://[domain]/svn/mortgages mortgages
    

    (Checkout ensues… then…)

    svn: In directory 'mortgages/trunk/images/rates'
    svn: Can't open file 'mortgages/trunk/images/rates/.svn/tmp/text-base/Header_3_nobookmark.gif.svn-base': No such file or directory
    

    Here SVN is trying to check out two files with similar names that differ only by case - Header_3_noBookmark.gif and Header_3_nobookmark.gif. Mac filesystems default to case insensitivity in a way that causes SVN to choke in situations like this. So...

    % cd mortgages/trunk/images/rates/
    % svn up
    svn: Working copy '.' locked
    svn: run 'svn cleanup' to remove locks (type 'svn help cleanup' for details)
    

    However, running svn cleanup doesn't work, as we know.

    % svn cleanup
    svn: In directory '.'
    svn: Error processing command 'modify-wcprop' in '.'
    svn: 'spacer.gif' is not under version control
    

    spacer.gif isn't the problem here… It just can't move past the previous error to the next file. So I deleted all of the files from the directory other than .svn, and removed the SVN log. This made cleanup work, so that I could check out and rename the offending file.

    % rm *; rm -rf .svn/log; svn cleanup
    % svn up Header_3_nobookmark.gif
    A    Header_3_nobookmark.gif
    Updated to revision 1087.
    % svn mv Header_3_nobookmark.gif foo
    A         foo
    D         Header_3_nobookmark.gif
    % svn up
    A    spacer.gif
    A    Header_3_noBookmark.gif
    

    Following this, I was able to go back to the root directory of the project, and run svn up to check out the rest of it.

    0 讨论(0)
  • 2020-12-04 05:23

    Run svn cleanup command in a terminal (if it fails from Eclipse which was my case):

    ~/path/to/svn-folder/$ svn cleanup
    

    I tried different solutions explained here, but none worked.

    Action TeamUpdate to head fails:

    svn: E155004: There are unfinished work items in '/home/user/path/to/svn-folder'; run 'svn cleanup' first.

    Action TeamCleanup fails with same error.

    Solution that worked for me: run svn cleanup command in a terminal.

    The command succeeded.

    Then TeamUpdate in Eclipse worked again.

    Note: my SVN version is 1.9.3.

    Also check Chris's answer if svn cleanup does not work.

    0 讨论(0)
  • 2020-12-04 05:24

    Things have changed with SVN 1.7, and the popular solution of deleting the log file in the .svn directory isn't feasible with the move to a database working-copy implementation.

    Here's what I did that seemed to work:

    1. Delete the .svn directory for your working copy.
    2. Start a new checkout in a new, temporary directory.
    3. Cancel the checkout (we don't want to wait for everything to get pulled down).
    4. Run a cleanup on this cancelled checkout.
    5. Now we have a new .svn directory with a clean database (although no/few files)
    6. Copy this .svn into your old, corrupted working directory.
    7. Run svn update and it should bring your new partial .svn directory up to speed with your old working directory.

    That's all a little confusing, process wise. Essentially, what we're doing is deleting the corrupt .svn then creating a new .svn for the same checkout path. We then move this new .svn to our old working directory and update it to the repo.

    I just did this in TSVN and it seems to work fine and not require a full checkout and download.

    -Jody

    0 讨论(0)
  • 2020-12-04 05:25

    I faced the same issue. After some searching on the Internet found the below article. Then realized that I was logged as a user different from the user that I had used to setup SVN under, a permission issue basically.

    0 讨论(0)
  • 2020-12-04 05:27

    I did sudo chmod 777 -R . to be able to change the permissions. Without sudo, it wouldn't work, giving me the same error as running other commands.

    Now you can do svn update or whatever, without having to scrap your entire directory and recreating it. This is especially helpful, since your IDE or text editor may already have certain tabs open, or have syncing problems. You don't need to scrap and replace your working directory with this method.

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