“马克” 带修改的 SVN 导出

发布于 2024-07-23 02:57:24 字数 244 浏览 7 评论 0原文

我正在寻找以下情况的解决方案。

我们使用 Subversion,除了使用签出的开发环境之外,我们还有一个测试环境,它应该尽可能类似于生产环境。

因此,我们现在已将其设置为使用 SVN 导出来更新环境。 但是,由于我们只想要最新版本,因此我们不知道导出了什么版本。

是否有某种方法可以“标记”此导出,例如通过添加一些生成的文件来指示导出了哪个版本? (我们不想导出标签,因为我们将在一个发布周期内更新多次。)

I'm looking for a solution for the following situation.

We're using Subversion, and besides the development environment, where we use checkouts, we have a test environment, which is supposed to resemble the production environment as closely as possible.

Therefore, we now have it set up so that the environment is updated by using SVN export. However, since we just want the latest revision, we don't know what revision has been exported.

Is there some way to "mark" this export, for example by adding some generated file, that indicates which revision was exported? (We don't want to export tags, as we will be updating several times within one release cycle.)

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(3

呆头 2024-07-30 02:57:24

您可以做的一件事是确保从已知版本导出,并将该版本号写入导出中的文本文件中。 svnversion 命令将告诉您工作目录的修订号。 因此,执行 svn update 获取最新版本,然后 svn export 到您的部署位置,然后 svnversion 将输出重定向到以下位置的文本文件:与出口相同的地方。 修订版号将是更新时的修订版,即使此后有人提交了新代码。

您当然希望在 shell 脚本或其他脚本中自动执行上述过程。

One thing you could do is make sure you're exporting from a known revision, and write that revision number to a text file in the export. The svnversion command will tell you the revision number of a working directory. So do an svn update to get the latest version, then svn export to your deployment location, then svnversion redirecting the output to a text file in the same place as the export. The revision number will be the revision as of the update, even if somebody has committed new code since then.

You will of course want to automate the above process in a shell script or something.

千紇 2024-07-30 02:57:24

您可以在导出之前(或之后)执行 svn info /path/to/repository ,但您必须锁定以确保没有进行任何更改。

或者,使用评论中描述的技术并通过 shell 脚本进行管道传输,例如:

svn export /path/to/repository | grep ^Exported > revision.txt

svn export /path/to/repository | tail -l > revision.txt

You could do svn info /path/to/repository just before (or after) exporting, but you'd have to lock to make sure no changes were made.

Alternately, using the technique described in your comment and piping through a shell script, like:

svn export /path/to/repository | grep ^Exported > revision.txt

or

svn export /path/to/repository | tail -l > revision.txt
旧故 2024-07-30 02:57:24

或者,您可以执行 svn update,然后从该本地副本执行 svn export。 这样做的好处是 Subversion 将使用“rsync”(或它使用的任何算法)来仅更新那些已更改的文件。 然后,您只需从本地副本导出,节省带宽,并通过本地结帐保留所有存储库信息。

创建两个目录,一个用于签出,一个用于导出,然后通过两步过程进行部署:

svn update /path/to/repository checkout/project
svn export checkout/project export/project

Alternately, you could do an svn update and then svn export from that local copy. The benefit of this is that Subversion will use "rsync" (or whatever algorithm it uses) to update only those files changed. And then you just export from your local copy, saving bandwidth, and retaining all the repository information with your local checkout.

Create two directories, one for checkout, and one for export, then deploy with a two-step process:

svn update /path/to/repository checkout/project
svn export checkout/project export/project
~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文