hook to limit size of changeset(s)?

Charles Pope charles.pope at retaininternational.com
Sun May 11 19:55:05 UTC 2008


>>>>
It appeared to be a good idea to have a check that no very large files
are commited (such as binaries) etc. So I thought I could write a hook
(using pretxncommit or pretxnchangegroup) that that will look at the
size of the patch of the latest attempted commit (i.e. something like
"hg log -p $HG_NODE | wc --bytes" and combines this with an if
statement to see whether it exceeds a given upper size limit. This
works (for changes in non-binary files) and for the examples I have
tested.
<<<<

I am not sure this directly helps, but I have a very simple solution for
limiting file sizes, which I think may have come from a suggestion here.

find -size -99M | hg add

This is for automated source folders versioning (for backup puposes), and I
just wanted to ensure I didn't try to version any very large files.

I am sure there will be a more specific solution along the way...

Charles
-- 
View this message in context: http://www.nabble.com/hook-to-limit-size-of-changeset%28s%29--tp17125055p17176554.html
Sent from the Mercurial mailing list archive at Nabble.com.




More information about the Mercurial mailing list