定期将修订从一个SVN存储库复制到另一个活动的SVN存储库

时间:2023-02-05 14:10:46

My company maintains two SVN repositories, Repository 1 and Repository 2:

我的公司维护着两个SVN存储库,Repository 1和Repository 2:

  1. This repository has multiple projects in it, and is only accessed by the developers within the company. Access is through HTTPS and authentication is through the Windows domain.
  2. 该存储库中包含多个项目,并且只能由公司内的开发人员访问。通过HTTPS进行访问,通过Windows域进行身份验证。

  3. This repository has a single project in it, and is accessed by the developers within the company, and our client's developers. Access is through svn:// and authentication is through the passwd file.
  4. 该存储库中包含一个项目,由公司内的开发人员和我们客户的开发人员访问。通过svn://进行访问,并通过passwd文件进行身份验证。

We have some code in a folder in Repository 1 that we would like to be downloaded to users of Repository 2. The obvious answer is to use SVN Externals, but as far as I can see, that would need the client's developers to have accounts on our domain, and our IT people don't like that.

我们在Repository 1的文件夹中有一些代码,我们希望将其下载到Repository 2的用户。显而易见的答案是使用SVN Externals,但据我所知,这需要客户的开发人员拥有帐户我们的域名,我们的IT人员不喜欢这样。

Therefore, the only solution I can see is some kind of cron job that runs periodically to copy the necessary files from Repository 1 to 2. I've found a tool called Tailor which claims to do what I need, but so far I've not managed to get it to work correctly.

因此,我能看到的唯一解决方案是某种cron作业,它定期运行以将必要的文件从Repository 1复制到2.我找到了一个名为Tailor的工具,声称可以做我需要的工作,但到目前为止我已经没设法让它正常工作。

Before I spend more time trying to get Tailor to work, does anyone have any suggestions of another approach? My last resort is to knock up a program to do it for me, which shouldn't be too hard, but it's always best to use an existing app if there is one!

在我花更多时间试图让Tailor工作之前,有没有人对另一种方法有任何建议?我的最后一招是打破一个程序为我做这个,这应该不会太难,但如果有的话,最好使用现有的应用程序!

Thanks in advance for any help/pointers!

在此先感谢任何帮助/指针!

Rich

4 个解决方案

#1


If SVN externals would work, but the only stumbling block is access rights, then why not make a clone of the repository and point the externals to that?

如果SVN外部可行,但唯一的绊脚石是访问权限,那么为什么不对存储库进行克隆并将外部指向?

SVN now has good support for mirroring:

SVN现在对镜像有很好的支持:

https://www.opends.org/wiki/page/MirroringASubversionRepository

You can lock down the mirror repository using any authentication scheme you like, for example, anonymous read-only access.

您可以使用任何您喜欢的身份验证方案锁定镜像存储库,例如,匿名只读访问。

However, you need to ensure that the only thing that updates the mirror is the svn sync command - the users of repository 2 won't be able to commit changes back to repository 1.

但是,您需要确保更新镜像的唯一内容是svn sync命令 - 存储库2的用户将无法将更改提交回存储库1。

This page has some very useful information:

此页面包含一些非常有用的信息:

http://svn.collab.net/repos/svn/trunk/notes/svnsync.txt

#2


I see you need to make changes from both repositories.

我发现你需要从两个存储库进行更改。

You might be able to use the same svnsync idea to build a write-through proxy.

您可以使用相同的svnsync构思来构建直写代理。

Using this, the mirror repository passes write requests back to the master proxy. Now I'm not sure at this point what happens with authentication, but it's probably worth investigating here.

使用此方法,镜像存储库将写入请求传递回主代理。现在我不确定身份验证会发生什么,但这可能值得在此进行调查。

Might also look at this info.

也可以看看这个信息。

#3


Do you need to have the external developers change the code in the folder in repository 2, if not you may not need to use SVN at all.

您是否需要让外部开发人员更改存储库2中文件夹中的代码,否则您可能根本不需要使用SVN。

In general, having two repositories with SVN with the same code in is going to be confusing.

通常,拥有两个具有相同代码的SVN的存储库将会令人困惑。

Other options

  • If you need the external developers to edit the files in repository 2, could you not have the externals going the other way, so repository1 has an externals definition to repository.
  • 如果您需要外部开发人员来编辑存储库2中的文件,那么您是否可以使用其他方式进行外部操作,因此repository1具有存储库的外部定义。

  • Go round your IT people by putting all the code on repository.
  • 通过将所有代码放在存储库中来绕过您的IT人员。

  • Use GIT.

#4


There is SVNReplicate, which maybe could be customized to work with a single project, but this seems a case where a distributed VCS should be more appropiate.

有SVNReplicate,可以自定义以使用单个项目,但这似乎是分布式VCS应该更合适的情况。

#1


If SVN externals would work, but the only stumbling block is access rights, then why not make a clone of the repository and point the externals to that?

如果SVN外部可行,但唯一的绊脚石是访问权限,那么为什么不对存储库进行克隆并将外部指向?

SVN now has good support for mirroring:

SVN现在对镜像有很好的支持:

https://www.opends.org/wiki/page/MirroringASubversionRepository

You can lock down the mirror repository using any authentication scheme you like, for example, anonymous read-only access.

您可以使用任何您喜欢的身份验证方案锁定镜像存储库,例如,匿名只读访问。

However, you need to ensure that the only thing that updates the mirror is the svn sync command - the users of repository 2 won't be able to commit changes back to repository 1.

但是,您需要确保更新镜像的唯一内容是svn sync命令 - 存储库2的用户将无法将更改提交回存储库1。

This page has some very useful information:

此页面包含一些非常有用的信息:

http://svn.collab.net/repos/svn/trunk/notes/svnsync.txt

#2


I see you need to make changes from both repositories.

我发现你需要从两个存储库进行更改。

You might be able to use the same svnsync idea to build a write-through proxy.

您可以使用相同的svnsync构思来构建直写代理。

Using this, the mirror repository passes write requests back to the master proxy. Now I'm not sure at this point what happens with authentication, but it's probably worth investigating here.

使用此方法,镜像存储库将写入请求传递回主代理。现在我不确定身份验证会发生什么,但这可能值得在此进行调查。

Might also look at this info.

也可以看看这个信息。

#3


Do you need to have the external developers change the code in the folder in repository 2, if not you may not need to use SVN at all.

您是否需要让外部开发人员更改存储库2中文件夹中的代码,否则您可能根本不需要使用SVN。

In general, having two repositories with SVN with the same code in is going to be confusing.

通常,拥有两个具有相同代码的SVN的存储库将会令人困惑。

Other options

  • If you need the external developers to edit the files in repository 2, could you not have the externals going the other way, so repository1 has an externals definition to repository.
  • 如果您需要外部开发人员来编辑存储库2中的文件,那么您是否可以使用其他方式进行外部操作,因此repository1具有存储库的外部定义。

  • Go round your IT people by putting all the code on repository.
  • 通过将所有代码放在存储库中来绕过您的IT人员。

  • Use GIT.

#4


There is SVNReplicate, which maybe could be customized to work with a single project, but this seems a case where a distributed VCS should be more appropiate.

有SVNReplicate,可以自定义以使用单个项目,但这似乎是分布式VCS应该更合适的情况。