如何在不访问 svn 服务器的情况下应用更改

发布于 2024-09-03 06:36:00 字数 128 浏览 5 评论 0原文

我们使用 svn 来开发大型 Web 应用程序,并且定期更新生产环境。生产服务器无法访问 svn(出于安全原因)。

自上次生产版本发布以来,将更改推送到新版本的最佳方法是什么?我们希望避免每次都重新创建整个网站,因为它非常大。

We are using svn for development of a large web application, and we do periodic updates to production. The production server does not have access to svn (for security reasons).

What is the best way to push the changes since the last production release for a new release? We would like to avoid re-creating the whole site each time, since it is very large.

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

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

发布评论

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

评论(2

停滞 2024-09-10 06:36:00

好吧,让我试一试。您可以解析 SVN update 命令输出并生成仅复制已更改文件的复制指令吗?

http://svnbook.red-bean.com/en/1.1/ch03s05。 html

让我们检查一下 svn update 的输出
多一点。当服务器发送
对您的工作副本的更改,一封信
代码显示在每个项目旁边
让您知道 Subversion 有哪些操作
执行以携带您的工作副本
最新:

U foo

文件 foo 已更新(已收到
来自服务器的更改)。

一个foo

已添加文件或目录 foo
到您的工作副本。

D foo

文件或目录 foo 是
已从您的工作副本中删除。

R foo

文件或目录 foo 是
替换到您的工作副本中;那
是, foo 被删除了,并且出现了一个新项目
添加了同名的。尽管
他们可能有相同的名字
存储库认为它们是
不同的对象具有不同的
历史。

G foo

文件 foo 收到新更改
来自存储库,但是您本地的
该文件的副本有您的
修改。要么改变了
不相交,或者变化是
和你当地的一模一样
修改,所以 Subversion 有
成功合并存储库的
更改为没有
问题。

C foo

收到的文件 foo 存在冲突
来自服务器的更改。变化
从服务器直接重叠你的
自己对文件的更改。不需要
不过,恐慌。这种重叠需要
由人(您)解决;我们
稍后讨论这种情况
章。

或者,如果您更喜欢半手动解决方案,您可以使用 diff 工具,例如 WinMergeAraxis Merge 同步两个目录。

编辑:

我认为“svn update”不会完全起作用,但我决定的是:

  • svn checkout 当前(旧)产品修订版本
  • svn 切换到准备生产的修订版(新)

我编写了一个脚本来捕获“切换”的输出。它将 U 和 A 操作转换为“添加”到 zip 存档。它将 D 操作翻译为要在生产服务器上执行的删除命令。在生产服务器上,我们只需解压存档并运行删除命令即可。

Well let me give a shot. You can parse the SVN update command output and generate copy instructions that only copy the files that were changed?

http://svnbook.red-bean.com/en/1.1/ch03s05.html

Let's examine the output of svn update
a bit more. When the server sends
changes to your working copy, a letter
code is displayed next to each item to
let you know what actions Subversion
performed to bring your working copy
up-to-date:

U foo

File foo was Updated (received
changes from the server).

A foo

File or directory foo was Added
to your working copy.

D foo

File or directory foo was
Deleted from your working copy.

R foo

File or directory foo was
Replaced in your working copy; that
is, foo was deleted, and a new item
with the same name was added. While
they may have the same name, the
repository considers them to be
distinct objects with distinct
histories.

G foo

File foo received new changes
from the repository, but your local
copy of the file had your
modifications. Either the changes did
not intersect, or the changes were
exactly the same as your local
modifications, so Subversion has
successfully merGed the repository's
changes into the file without a
problem.

C foo

File foo received Conflicting
changes from the server. The changes
from the server directly overlap your
own changes to the file. No need to
panic, though. This overlap needs to
be resolved by a human (you); we
discuss this situation later in this
chapter.

Or if you prefer a semi-manual solution you can use a diff tool like WinMerge or Araxis Merge to sync both directories.

EDIT:

I don't think "svn update" will work exactly, but what I settled on was:

  • svn checkout of the current (old) prod revision
  • svn switch to the revision that is ready for prod (new)

I wrote a script to capture the output of the "switch". It translates U and A operations to "adds" to a zip archive. It translates D operations to delete commands to be executed on the production server. On the production server, we just need to unzip the archive and run the delete commands.

失而复得 2024-09-10 06:36:00

签出玻璃墙一侧的目录,使其可以从生产服务器访问。使用某种 diff/sync 实用程序来同步两者,减去 _svn 文件夹或任何其他会污染生产环境的文件。

或者使用包含“自 mm/dd/yyyy 以来的更改”的文件的 zip(或其他存档),并将其应用到生产目录。

Do a checkout to a directory on your side of the glass wall, make it accessible from the production server. Use some sort of diff/sync utility to synchronize the two, minus the _svn folders or any other files that would contaiminate the production environment.

Or use a zip (or other archive) of files with "changes since mm/dd/yyyy", and apply it to the prodution directory.

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