Summary:
This patch made changes needed to support lfs, and added a test.
The test was partially copied from `fb-hgext/tests/test-lfs.t`.
`require-ext.sh` was backported from fb-hgext.
Test Plan: Added a test
Reviewers: #mercurial, rmcelroy
Reviewed By: rmcelroy
Subscribers: rmcelroy, stash
Differential Revision: https://phabricator.intern.facebook.com/D4809342
Signature: t1:4809342:1490958029:e67903d53d2d7c80fffa6739cb92dbfa2a8d0962