comparison hgext/largefiles/overrides.py @ 31892:9e67ce5c4fd0

largefiles: set the extension as enabled locally after a share requiring it This has been done for clone since e1dbe0b215ae, so it makes sense here for the same reasons.
author Matt Harbison <matt_harbison@yahoo.com>
date Tue, 11 Apr 2017 20:54:50 -0400
parents a40e979b9d97
children 09fb3d3b1b3a d3ab31bf9c0e
comparison
equal deleted inserted replaced
31891:87f293edabb6 31892:9e67ce5c4fd0
901 if missing != 0: 901 if missing != 0:
902 return None 902 return None
903 903
904 return result 904 return result
905 905
906 def hgpostshare(orig, sourcerepo, destrepo, bookmarks=True, defaultpath=None):
907 orig(sourcerepo, destrepo, bookmarks, defaultpath)
908
909 # If largefiles is required for this repo, permanently enable it locally
910 if 'largefiles' in destrepo.requirements:
911 with destrepo.vfs('hgrc', 'a+', text=True) as fp:
912 fp.write('\n[extensions]\nlargefiles=\n')
913
906 def overriderebase(orig, ui, repo, **opts): 914 def overriderebase(orig, ui, repo, **opts):
907 if not util.safehasattr(repo, '_largefilesenabled'): 915 if not util.safehasattr(repo, '_largefilesenabled'):
908 return orig(ui, repo, **opts) 916 return orig(ui, repo, **opts)
909 917
910 resuming = opts.get('continue') 918 resuming = opts.get('continue')