BigFiles Extension for Mercurial

The BigFiles Extension is a plugin for Mercurial that allows you to more efficiently manage Big files and Binary files.For more on this problem see this link Binary Files and Mercurial.

NOTE: For another solution to this problem see BFiles Extension for Mercurial.

  • to see all the commands supported by the extension:
    hg -v help b
    
    list of commands:
    
     backout:
          reverse effect of earlier changeset
     bigadd, badd:
          add the specified files to big files repo
     bigrefresh, brefresh:
          update big files tracking as per working directory.
     bigstatus, bstatus:
          show changed big files in the working directory
     bigupdate, bup, bigcheckout, bco:
          fetch files from versions directory as recorded in '.bigfiles'.
     bisect:
          subdivision search of changesets
     branch:
          set or show the current branch name
     branches:
          list repository named branches
     bundle:
          create a changegroup file

Download and Unzip Extension

Congifure in .hg/hgrc file:

[extensions]
bigfiles = C:\bigfiles_MercurialExtension\bigfiles\bigfiles.py

[bigfiles]
repo = C:\bigfilesCentralRepo

Usage:

Add file:

hg badd MyProject/testing.zip
  • This creates a file called .bigfilesin my root directory that looks like:
    syntax: glob
    
    MyProject/testing.zip#dae6a7a3ad905bf47c2cce5480f0e273d1cfc3c8
  • This also created a binary representation of your file in the bigfiles repository:
    C:\bigfilesCentralRepo\MyProject\testing.zip.dae6a7a3ad905bf47c2cce5480f0e273d1cfc3c8

Status:

hg bstat

S FSbuild/testing.zip

Mercurial add will add .bigfiles but ignore the testing.zip

hg -v add

adding .bigfiles
    • Notice that Mercurial ignored the testing.zip file altogether.
  • Commit and Push as normal
    • Mercurial will commit and push the .bigfiles but not the actual binary.

Binary File Modifications:

  • Just to brefresh to update the modified binary:
    hg -v brefresh
    • This will update the .bigfiles has for that zip:
      syntax: glob
      
      MyProject/testing.zip#72a893481fa75138270f7be0f00481dae52c533d
      • NOTICE the hash is different from above
  • It will place a version of the binary file in the repository as well:
    C:\bigfilesCentralRepo\MyProject\testing.zip.dae6a7a3ad905bf47c2cce5480f0e273d1cfc3c8
    C:\bigfilesCentralRepo\MyProject\testing.zip.72a893481fa75138270f7be0f00481dae52c533d
  • Commit and push as normal.

Problems integrating with TortoiseHG:

Issues:

  • To add a bigfile you need to do it on the command line before refreshing in TortoiseHG
  • If you modify the bigfile you need to do a brefresh on the command line before refreshing and committing in TortoiseHG (otherwise it won’t see it)
  • Although it doesn’t totally crap out like the BFilesExtension…when you commit with this extension you’ll see the uncommitted zip file (unchecked but still there)
    • In other words it doesn’t quite ignore it.

On the plus side the downloading of the appropriate binary seems rather seamless just through a TortoiseHG update.

It's only fair to share...
Share on FacebookGoogle+Tweet about this on TwitterShare on LinkedIn

Leave a Reply