开发者

How to apply changes without access to svn server

开发者 https://www.devze.com 2023-01-01 08:14 出处:网络
We are using svn for development of a large web application, and we do periodic updates t开发者_JS百科o production.The production server does not have access to svn (for security reasons).

We are using svn for development of a large web application, and we do periodic updates t开发者_JS百科o 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.


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.


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.

0

精彩评论

暂无评论...
验证码 换一张
取 消