压缩XML文件的Subversion差异 [英] Subversion diff for zipped xml file

查看:145
本文介绍了压缩XML文件的Subversion差异的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在使用MySQL Workbench维护应用程序的数据库架构. Workbench使用的.mwb文件是一个压缩的XML文档,保存在Subversion存储库中.

I'm using MySQL Workbench to maintain the database schema for an application. The .mwb file that Workbench uses, which is a zipped XML document, is kept in a Subversion repository.

该文件被Subversion视为二进制数据,因此我不能使用svn diff来显示更改,例如在提交之前.

The file is treated as binary data by Subversion, so I cannot use svn diff to show the changes, for example before committing.

由于数据实际上是XML,所以我认为无论如何都可能显示差异,也许有一些脚本可以以前解压缩文件,或者有一些插件到svn diff.

Since the data is really XML, I'm thinking there might be some way to show the diff anyway, maybe some script that unzips the file before, or some plugin to svn diff.

理想的解决方案可以做到这一点:

The ideal solution would allow this:

$ svn diff db-model.mwb

甚至使用Meld:

$ meld db-model.mwb

您能想到哪种方法来实现这一目标?也许其他人遇到了在Subversion中显示存档文本文件的差异的问题.

What approach can you think of to accomplish this? Maybe someone else has had this problem of showing diff's for archived text files in Subversion.

推荐答案

Subversion允许您使用

Subversion allows you to use external differencing tools . What you can do is write a wrapper script, and tell Subversion to use it as its "diff" command. Your wrapper would parse the arguments it gets from Subversion to pick out the "left" and "right" filenames, operate on them, and return an error code that Subversion will interpret as success or failure. In your case, the wrapper could unzip the XML files, and pass the unzipped results to "diff" or another tool of your choice.

Subversion将阻止在签入时检测到二进制"的差异文件.-force"选项可让您覆盖此检查,因此即使输入文件也将运行包装器脚本将作为二进制文件签入.

Subversion will balk at diff-ing files that were detected as "binary" when they were checked in. The "--force" option lets you override this check, so your wrapper script will be be run even if the input files are checked in as binaries.

这篇关于压缩XML文件的Subversion差异的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆