Subversion 合并插件/签入后/签出前挂钩

发布于 2024-10-09 13:56:11 字数 758 浏览 0 评论 0原文

我想对一组构建为 zip 文件(包含 XML 文件)的文件进行源代码管理。

由于目前这些文件按原样签入,因此它们被视为具有所有明显限制的二进制文件

由于这些文件包含 XML 文件,为了避免要求程序员压缩/解压缩,我想自动执行以下操作

用于检查-ins:自动分解文件:

  • 这些文件具有唯一的扩展名,因此对于使用该扩展名签入的每个文件,
  • 将该文件解压缩到内存/临时位置
  • 对于每个文件(XML)将它们标准化(用于比较/合并)
    • 按照预定义的顺序(例如字母顺序)重新排序根的直接子节点
    • 有些项目有本地参考 ID,排序后按顺序重写 ID
  • 在 SVN 中创建一个与原始压缩文件同名的文件夹
  • 签入文件在 zip 中进入该文件夹

用于签出:自动重新打包文件:

  • 不太重要 - 可以使用 Maven / Ant
  • 完成签出分解的文件夹(或其任何内容文件)
  • 时而不是检查取出该文件夹/文件:
  • 压缩该文件夹上的所有文件
  • 并查看压缩文件

用于合并

我假设合并不是 SVN 服务器端,而是客户端的责任,所以有没有一种简单的方法编写一个合并插件,(例如对于Tortoise)

以上任何一个都可能吗?如果是这样那怎么办?有不止一种方法吗?

I would like to source-manage a set of files that are built as zip files, containing XML files.

Since currently those files are checked in as is, they are treated as binary files with all obvious limitations

Since those files contain XML files, to avoid asking programmers to zip / unzip, I would like to do the following, automatically

For check-ins: automatically explode the files:

  • These files have a unique extention, so for each file checked in with that extension
  • unzip that file to memory / temp location
  • For each of those files (XML) normalize them (for comparing / merging)
    • Reorder the root's direct child nodes in a predefined order (e.g. alphabetical)
    • Some items have local reference IDs, rewrite the IDs sequentialy after the sort
  • create a folder in SVN with the same name as the original zipped file
  • check in the files in the zip into that folder

For check-outs: automatically repackage the files:

  • Less important - can be done using Maven / Ant
  • When checking out the exploded folder (or any of it's content files)
  • Instead of checking out that folder / files:
  • Zip all the files on that folder
  • And check out the zipped file

For Merges

I assume the merge is not SVN server side, and is the client's responsibility, so is there an easy way to write a merge plugin instead, (e.g. for Tortoise)

Is the any of the above possible? if so then how? is there more than one way?

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

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

发布评论

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

评论(1

怀念你的温柔 2024-10-16 13:56:11

与其使预/后签入挂钩复杂化,不如在创建这些 zip 文件的应用程序周围编写包装器会更容易。包装器应解压缩所有文件并将它们提供在一个文件夹中。

另一种方式就是你所描述的。但复杂性在于需要一个触发器来对所有 zip 文件执行此操作。您最终可能会在触发器中使用另一个过滤器,仅对特定文件夹中的文件执行此操作,并且必须在单独的数据库中维护这些文件夹集。为了避免这些复杂性,请在应用程序周围编写一个包装器。

Instead of complicating the pre/post checkin hook writing a wrapper around the application that creates these zip files would be easier. The wrapper shall unzip all the files and provide them in a folder.

The other way is what you have described. But the complexity is to have a trigger to do this for all the zip files. You might end up with another filter in the trigger to do this only for files from specific folders and have to maintain those set of folders in a separate DB. To avoid these complexities write a wrapper around the application.

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