##// END OF EJS Templates
largefiles: set the extension as enabled locally after a share requiring it...
Matt Harbison -
r31892:9e67ce5c default
parent child Browse files
Show More
@@ -903,6 +903,14 b' def hgclone(orig, ui, opts, *args, **kwa'
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)
@@ -120,6 +120,7 b' def uisetup(ui):'
120 _('download all versions of all largefiles'))]
120 _('download all versions of all largefiles'))]
121 entry[1].extend(cloneopt)
121 entry[1].extend(cloneopt)
122 entry = extensions.wrapfunction(hg, 'clone', overrides.hgclone)
122 entry = extensions.wrapfunction(hg, 'clone', overrides.hgclone)
123 entry = extensions.wrapfunction(hg, 'postshare', overrides.hgpostshare)
123
124
124 entry = extensions.wrapcommand(commands.table, 'cat',
125 entry = extensions.wrapcommand(commands.table, 'cat',
125 overrides.overridecat)
126 overrides.overridecat)
@@ -212,6 +212,18 b" verify that largefiles doesn't break fil"
212 date: Thu Jan 01 00:00:00 1970 +0000
212 date: Thu Jan 01 00:00:00 1970 +0000
213 summary: add files
213 summary: add files
214
214
215 sharing a largefile repo automatically enables largefiles on the share
216
217 $ hg share --config extensions.share= . ../shared_lfrepo
218 updating working directory
219 getting changed largefiles
220 1 largefiles updated, 0 removed
221 3 files updated, 0 files merged, 0 files removed, 0 files unresolved
222 $ cat ../shared_lfrepo/.hg/hgrc
223
224 [extensions]
225 largefiles=
226
215 verify that large files in subrepos handled properly
227 verify that large files in subrepos handled properly
216 $ hg init subrepo
228 $ hg init subrepo
217 $ echo "subrepo = subrepo" > .hgsub
229 $ echo "subrepo = subrepo" > .hgsub
@@ -240,6 +240,14 b' test that commits work'
240 bm3 4:62f4ded848e4
240 bm3 4:62f4ded848e4
241 $ cd ..
241 $ cd ..
242
242
243 non largefiles repos won't enable largefiles
244
245 $ hg share --config extensions.largefiles= repo3 sharedrepo
246 updating working directory
247 2 files updated, 0 files merged, 0 files removed, 0 files unresolved
248 $ [ -f sharedrepo/.hg/hgrc ]
249 [1]
250
243 test pushing bookmarks works
251 test pushing bookmarks works
244
252
245 $ hg clone repo3 repo4
253 $ hg clone repo3 repo4
General Comments 0
You need to be logged in to leave comments. Login now