Copy/Commit 通过 CI 本地未版本化文件到 SVN 版本化文件

Copy/Commit locally unversioned file to SVN versioned file via CI

我正在使用 Jenkins 生成一个我想在 SVN 中提交的文件。

生成的文件不是本地版本化的,而是要替换 SVN 上的文件。 为了达到这个目的,我 运行 这个命令

svn delete <URL to file>
svn import <Local file path> <URL to file>

我工作了,但是我丢失了文件的日志历史记录

有什么方法可以在不丢失日志历史记录的情况下做到这一点?

我正在尝试提交文件,但没有成功。提交甚至有意义吗?

我能做到的最好的是:

>svn commit --force-log -F <Local file path> <SVN URL path to folder of the file> --username [*******] --password [*******] 
svn: E205000: Try 'svn help commit' for more information
svn: E205000: Commit targets must be local paths
svn: E205000: <SVN URL path to folder of the file> is not a local path

我正在用这个来指导自己,但没有太大的成功 SVN CI documentation

非常感谢!

你不应该svn delete这个文件,这是历史丢失的时候。相反,您应该在本地获取版本控制文件,更改它,然后提交它。为此,您需要先检查包含版本控制文件的目录。

假设你要更新的文件URL是<URL_path>/<file>,而你的本地文件是<local_file>,你可以这样做:

svn checkout <URL_path> foo
cp -f <local_file> foo/<file>
svn commit foo/<file> -m "commit message"