##// 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 886 finally:
887 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 897 def overridearchive(orig, repo, dest, node, kind, decode=True, matchfn=None,
890 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 902 return orig(repo, dest, node, kind, decode, matchfn, prefix, mtime,
893 903 subrepos)
894 904
@@ -119,6 +119,8 b' def uisetup(ui):'
119 119 extensions.wrapfunction(archival, 'archive', overrides.overridearchive)
120 120 extensions.wrapfunction(subrepo.hgsubrepo, 'archive',
121 121 overrides.hgsubrepoarchive)
122 extensions.wrapfunction(webcommands, 'archive',
123 overrides.hgwebarchive)
122 124 extensions.wrapfunction(cmdutil, 'bailifchanged',
123 125 overrides.overridebailifchanged)
124 126
@@ -15,6 +15,8 b' of largefiles.'
15 15 > minsize=2
16 16 > patterns=glob:**.dat
17 17 > usercache=${USERCACHE}
18 > [web]
19 > allow_archive = zip
18 20 > [hooks]
19 21 > precommit=sh -c "echo \\"Invoking status precommit hook\\"; hg status"
20 22 > EOF
@@ -215,6 +217,17 b' Clone over http, no largefiles pulled on'
215 217 adding file changes
216 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 231 test 'verify' with remotestore:
219 232
220 233 $ rm "${USERCACHE}"/02a439e5c31c526465ab1a0ca1f431f76b827b90
General Comments 0
You need to be logged in to leave comments. Login now