hgext/lfs/wrapper.py
changeset 35214 a8c778b2a689
parent 35213 24aa4853c031
child 35215 8887a45e3384
--- a/hgext/lfs/wrapper.py	Thu Nov 16 20:23:20 2017 -0500
+++ b/hgext/lfs/wrapper.py	Thu Nov 16 21:01:21 2017 -0500
@@ -221,6 +221,14 @@
 
     return result
 
+def hgpostshare(orig, sourcerepo, destrepo, bookmarks=True, defaultpath=None):
+    orig(sourcerepo, destrepo, bookmarks, defaultpath)
+
+    # If lfs is required for this repo, permanently enable it locally
+    if 'lfs' in destrepo.requirements:
+        with destrepo.vfs('hgrc', 'a', text=True) as fp:
+            fp.write('\n[extensions]\nlfs=\n')
+
 def _canskipupload(repo):
     # if remotestore is a null store, upload is a no-op and can be skipped
     return isinstance(repo.svfs.lfsremoteblobstore, blobstore._nullremote)