How to update a SVN file without performing a checkout?

后端 未结 5 1467
故里飘歌
故里飘歌 2020-12-30 02:46

I am writing some scripts to update the Linux box\'s SVN repo with newer versions of xml files. The repo is huge, and there is no checkout version on the same box. The idea

5条回答
  •  慢半拍i
    慢半拍i (楼主)
    2020-12-30 03:34

    You cannot commit a change without a working copy. The reason is that svn does not send the file to the server, it sends the delta (ie the differences). This is designed to reduce network traffic, but obviously, it needs to know the previous version in order to calculate the diff.

    You can checkout a working copy using the sparse options, so you can create a WC with just that 1 file in it, there's no need to checkout the entire repository. Alternatviely, you can expose the repo using webdav, then you just copy the new file over the old one and the auto-commit option will calculate the diff and checkin the file.

    You could store a working copy in your temp location, then you just need to copy the files there and commit. There's no need to delete the WC, just make sure only a special svn user can access it and you can leave the WC there for the next time you need to do this.

提交回复
热议问题