4

I'm starting a game development project and my team and I will be using Mercurial for version control and I was wondering what a more appropriate way to store the binary assets for the game would be. Basically, I have 2 options:

  1. Mercurial 2.1 has the largefiles extension, but I don't know too much about it. It seems like it'll solve the 'repository bloat' problem but doesn't solve binary merge conflict issues.

  2. Keeping the binary assets in a SVN checkout, as a subrepo. This way we can lock files for editing and avoid merge conflicts, but I would really like to avoid having to use 2 version control systems (especially one that I don't really like that much).

Any insight/advice or other options I haven't thought of?

Chris S
  • 64,770
  • 52
  • 221
  • 239

2 Answers2

1

As you surmised large files will do what you need. For merging binaries you can set up a merge tool if one exists for your file type. Something like this:

[merge-tools]
mymergetool.priority = 100
mymergetool.premerge = False
mymergetool.args = $local $other $base -o $output
myimgmerge = SOME-PROGRAM-THAT-WILL-MERGE-IMAGES-FOR-YOU
[merge-patterns]
**.jpg = myimgmerge
**.exe = internal:fail

In general though, merging non-text things will always be a pain using a source control tool. Digital Asset Management applications exist to make that less painful, but they're not decentralized or very pleasant with which to work.

Martin Geisler
  • 72,968
  • 25
  • 171
  • 229
Ry4an Brase
  • 78,112
  • 7
  • 148
  • 169
1

You're correct that the largefiles extension will avoid bloating the repository. What happens is that you only download the large files needed by the revision you're checking out. So if you have a 50 MB file and it has been edited radically 10 times, then the versions might take up 500 MB on the server. However, when you do hg update you only download the 50 MB version you need for that revision.

You're also correct that the largefiles extension doesn't help with merges. Infact, it skips the merge step completely and only prompts you like this:

largefile <some large file> has a merge conflict
keep (l)ocal or take (o)ther?

You don't get a chance to use the normal merge machinery.

To do locking, you could use the lock extension I wrote for a client. They wanted it for their documentation department where people would work with files that cannot be easily merged. It basically turns Mercurial into a centralized system similar to Subversion: locks are stored in a file in the central repository and client contact this repository when you run hg locks and before hg commit.

Martin Geisler
  • 72,968
  • 25
  • 171
  • 229
  • looks like a pretty nice extension, but that would mean hosting services like Bitbucket would be ruled out? –  Feb 11 '12 at 14:04
  • 2
    @darkestfright: If you mean the lock extension, then yes, it doesn't work with Bitbucket since it's not enabled on their servers. It's really meant for use inside a company — your `hg` will be talking a lot with the lock server so you want the lock server to be close by. – Martin Geisler Feb 12 '12 at 08:20