##// END OF EJS Templates
largefiles: restore archiving largefiles with hgweb (issue4859)...
Matt Harbison -
r26417:9a466b9f 3.5.2 stable
parent child Browse files
Show More
@@ -886,9 +886,19 b' def overridearchivecmd(orig, ui, repo, d'
886 finally:
886 finally:
887 repo.unfiltered().lfstatus = False
887 repo.unfiltered().lfstatus = False
888
888
889 def hgwebarchive(orig, web, req, tmpl):
890 web.repo.lfstatus = True
891
892 try:
893 return orig(web, req, tmpl)
894 finally:
895 web.repo.lfstatus = False
896
889 def overridearchive(orig, repo, dest, node, kind, decode=True, matchfn=None,
897 def overridearchive(orig, repo, dest, node, kind, decode=True, matchfn=None,
890 prefix='', mtime=None, subrepos=None):
898 prefix='', mtime=None, subrepos=None):
891 if not repo.lfstatus:
899 # For some reason setting repo.lfstatus in hgwebarchive only changes the
900 # unfiltered repo's attr, so check that as well.
901 if not repo.lfstatus and not repo.unfiltered().lfstatus:
892 return orig(repo, dest, node, kind, decode, matchfn, prefix, mtime,
902 return orig(repo, dest, node, kind, decode, matchfn, prefix, mtime,
893 subrepos)
903 subrepos)
894
904
@@ -119,6 +119,8 b' def uisetup(ui):'
119 extensions.wrapfunction(archival, 'archive', overrides.overridearchive)
119 extensions.wrapfunction(archival, 'archive', overrides.overridearchive)
120 extensions.wrapfunction(subrepo.hgsubrepo, 'archive',
120 extensions.wrapfunction(subrepo.hgsubrepo, 'archive',
121 overrides.hgsubrepoarchive)
121 overrides.hgsubrepoarchive)
122 extensions.wrapfunction(webcommands, 'archive',
123 overrides.hgwebarchive)
122 extensions.wrapfunction(cmdutil, 'bailifchanged',
124 extensions.wrapfunction(cmdutil, 'bailifchanged',
123 overrides.overridebailifchanged)
125 overrides.overridebailifchanged)
124
126
@@ -15,6 +15,8 b' of largefiles.'
15 > minsize=2
15 > minsize=2
16 > patterns=glob:**.dat
16 > patterns=glob:**.dat
17 > usercache=${USERCACHE}
17 > usercache=${USERCACHE}
18 > [web]
19 > allow_archive = zip
18 > [hooks]
20 > [hooks]
19 > precommit=sh -c "echo \\"Invoking status precommit hook\\"; hg status"
21 > precommit=sh -c "echo \\"Invoking status precommit hook\\"; hg status"
20 > EOF
22 > EOF
@@ -215,6 +217,17 b' Clone over http, no largefiles pulled on'
215 adding file changes
217 adding file changes
216 added 1 changesets with 1 changes to 1 files
218 added 1 changesets with 1 changes to 1 files
217
219
220 Archive contains largefiles
221 >>> import urllib2, os
222 >>> u = 'http://localhost:%s/archive/default.zip' % os.environ['HGPORT2']
223 >>> with open('archive.zip', 'w') as f:
224 ... f.write(urllib2.urlopen(u).read())
225 $ unzip -t archive.zip
226 Archive: archive.zip
227 testing: empty-default/.hg_archival.txt OK
228 testing: empty-default/f1 OK
229 No errors detected in compressed data of archive.zip.
230
218 test 'verify' with remotestore:
231 test 'verify' with remotestore:
219
232
220 $ rm "${USERCACHE}"/02a439e5c31c526465ab1a0ca1f431f76b827b90
233 $ rm "${USERCACHE}"/02a439e5c31c526465ab1a0ca1f431f76b827b90
General Comments 0
You need to be logged in to leave comments. Login now