views:

494

answers:

1

I have a large file in my Mercurial repository that is preventing my repository from being uploaded to Bitbucket. I get the error:

abort: HTTP Error 413: Request Entity Too Large

Fortunately the file extension for this file is different from everything else in my repository so it should be easy to create a rule to exclude it. However, the file has been included in commits in the repository up until a few days ago when it probably became too large. Do I need to remove it from history as well as future commits? What command do I need to do this?

I found this document on "IncludeExclude Proposal" but I'm not sure if it's a proposed feature or an actual one:

http://mercurial.selenic.com/wiki/IncludeExcludeProposal

+3  A: 

If you've already committed it, and it looks like you have, then exclude (aka hgignore) won't work for you.

.hgignore (and the never adopted advanced syntax you see in InlcudeExcludeProposal) help prevent you from accidentally adding a file you don't want to add. Once you've added a file hgignore has no effect, and once you've committed that add it's there's no way to remove it from history without EditingHistory

If you can just get rid of the last few commits (with intent to re-do all but the big-file adds) you can use hg clone -r lastknowngoodextension existingrepopath newrepopath and you'll have your repo minus those unwanted extensions at newrepopath. I think, Bitbucket offers a web interface to remove changesets, but I'm not certain.

If you can't just clone (or strip) away the last few revisions then you're in the EditingHistory space, using mq or convert or similar.

If you want those files tracked but not in the repo you might want to look at the bfiles extension.

Ry4an