문제

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?

도움이 되었습니까?

해결책

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.

라이센스 : CC-BY-SA ~와 함께 속성
제휴하지 않습니다 StackOverflow
scroll top