Results 1 to 3 of 3

Thread: How to merge/track files that need an external app to get to text form?

  1. #1

    How to merge/track files that need an external app to get to text form?

    Folks,

    I'm using TortoiseSVN on Windows 7 talking to a mod_dav server in Apache hosted in Fedora 13. While TSVN is working for me, it might be possible to use another tool if that would help.

    The svn repo I maintain contains a lot of files for a simulator. The files define the simulator environment and are in fact well-formed XML. However the simulator stores them on disk as compressed files (*.bin), and the so the repo does too. This is all fine, except I lose the ability to track and merge changes.

    Is there a way (hook?), when TSVN sees a file is different, for it to call an uncompress utility on the files from disk and repo, do the merge/whatever, and then recompress again once finished? I have the compressor (not ZIP - it's special). I emphasise: the use of compressed files is not my choice, it's the simulator's, and I can't alter that. There is never more than one XML file in a compressed file (think gzip not unzip)

    So, just to be clear, I imagine the current svn client side update process to be something like:

    Code:
    for each working file do
      if working version number lower than repo version number {file out of date}
        if date or size properties differ from base version And
               checksum differs from base version And file is mergeable {working version modified }
          fetch latest version {now have 3: base, latest, working }
          diff3 base version, latest version, working version { now have patch to working }
          if diff patches don't conflict
            patch working version
          else
            mark for manual merge
          end if
        end if
      end if
    end for
    ... probably left stuff out but, assuming it's not too bad, I'm saying : can this be modified to:

    Code:
    for each working file do
      if working version number lower than repo version number {file out of date}
        if date or size properties differ from base version And
               checksum differs from base version And file is mergeable {working version modified }
          fetch latest version {now have 3: base, latest, working }
          uncompress just-fetched latest version {read only, temporary }
          uncompress working version {to be patched, temporary }
          uncompress base version {read only, temporary }
          diff3 base version, latest version, working version { now have patch to working }
          if diff patches don't conflict
            patch working version
            compress working version {new working version }
          else
            mark for manual merge
          end if
          delete temporary files
        end if
      end if
    end for
    Of course, similar changes would be needed in some other code paths, notably view differences.

    Thanks
    Ruth
    Last edited by rivimey; 04-06-2012 at 12:12 PM. Reason: add bold

  2. #2
    Senior Member Site ModeratorSite Admin
    Join Date
    Mar 2011
    Location
    Chesterfield, UK
    Posts
    771
    What prevents you from storing the uncompressed files in the repository?
    Mat Booth
    Software Engineer
    WANdisco, Inc.

    I joined the blog-o-web-o-sphere! Linux and Coding Blog

    How To Ask Smart Questions

  3. #3
    Quote Originally Posted by mbooth View Post
    What prevents you from storing the uncompressed files in the repository?
    Thanks for your reply, but that would mean two things:

    The repository (currently 2.5GB) would be significantly (5x?) bigger: the compression ratio is over 80% on these files, and while you might say disk is cheap, the repo is accessed over the internet on a 500kbps link. The working copy already exceeds 3.5GB.

    But mainly: how would the files become uncompressed? They are saved compressed by the creator application and must stay that way for that app to work, so svn would have to decompress them during commit and recompress them during update, with a compressor tool that is not particularly quick.

    Regards
    Ruth

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •