comparison hgext/lfs/wrapper.py @ 35214:a8c778b2a689

lfs: enable the extension locally after sharing a repo with 'lfs' requirement This is consistent with clone in the previous commit.
author Matt Harbison <matt_harbison@yahoo.com>
date Thu, 16 Nov 2017 21:01:21 -0500
parents 24aa4853c031
children 8887a45e3384
comparison
equal deleted inserted replaced
35213:24aa4853c031 35214:a8c778b2a689
218 if 'lfs' in repo.requirements: 218 if 'lfs' in repo.requirements:
219 with repo.vfs('hgrc', 'a', text=True) as fp: 219 with repo.vfs('hgrc', 'a', text=True) as fp:
220 fp.write('\n[extensions]\nlfs=\n') 220 fp.write('\n[extensions]\nlfs=\n')
221 221
222 return result 222 return result
223
224 def hgpostshare(orig, sourcerepo, destrepo, bookmarks=True, defaultpath=None):
225 orig(sourcerepo, destrepo, bookmarks, defaultpath)
226
227 # If lfs is required for this repo, permanently enable it locally
228 if 'lfs' in destrepo.requirements:
229 with destrepo.vfs('hgrc', 'a', text=True) as fp:
230 fp.write('\n[extensions]\nlfs=\n')
223 231
224 def _canskipupload(repo): 232 def _canskipupload(repo):
225 # if remotestore is a null store, upload is a no-op and can be skipped 233 # if remotestore is a null store, upload is a no-op and can be skipped
226 return isinstance(repo.svfs.lfsremoteblobstore, blobstore._nullremote) 234 return isinstance(repo.svfs.lfsremoteblobstore, blobstore._nullremote)
227 235