Bug 4859 - zip archives downloaded via hgweb no longer contain largefiles
Summary: zip archives downloaded via hgweb no longer contain largefiles
Status: RESOLVED FIXED
Alias: None
Product: Mercurial
Classification: Unclassified
Component: hgweb (show other bugs)
Version: 3.5.1
Hardware: PC Windows
: urgent bug
Assignee: Bugzilla
URL:
Keywords: regression
Depends on:
Blocks:
 
Reported: 2015-09-29 05:06 UTC by Bastian Wassermann
Modified: 2015-10-27 00:00 UTC (History)
6 users (show)

See Also:
Python Version: ---


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Bastian Wassermann 2015-09-29 05:06 UTC
Since i installed hg for python x86 in version 3.5.1, the zip archive which can be enabled with allow_archive in hgweb.config, does not contain largefiles, but in archival there are the largefile standins in .hglf directory.
Comment 1 Matt Mackall 2015-09-29 11:58 UTC
regression -> urgent

Matt, can you take a look at this?
Comment 2 Matt Harbison 2015-09-29 12:21 UTC
I'll take a look later tonight when I get a chance, but I'm assuming it is related to this:

changeset:   26499:7699d3212994
user:        Matt Harbison <matt_harbison@yahoo.com>
date:        Sat Jul 11 23:26:33 2015 -0400
summary:     largefiles: allow the archiving of largefiles to be disabled

Probably largefiles needs to override something in hgweb and set 'repo.lfstatus = True' like is being done here for the archive command.
Comment 3 Augie Fackler 2015-09-29 13:12 UTC
Patch that passes on 3.4 and fails on tip:

diff --git a/tests/test-largefiles-wireproto.t b/tests/test-largefiles-wireproto.t
--- a/tests/test-largefiles-wireproto.t
+++ b/tests/test-largefiles-wireproto.t
@@ -15,6 +15,8 @@ of largefiles.
   > minsize=2
   > patterns=glob:**.dat
   > usercache=${USERCACHE}
+  > [web]
+  > allow_archive = zip
   > [hooks]
   > precommit=sh -c "echo \\"Invoking status precommit hook\\"; hg status"
   > EOF
@@ -215,6 +217,17 @@ Clone over http, no largefiles pulled on
   adding file changes
   added 1 changesets with 1 changes to 1 files
 
+Archive contains largefiles
+  >>> import urllib2, os
+  >>> u = 'http://localhost:%s/archive/default.zip' % os.environ['HGPORT2']
+  >>> with open('archive.zip', 'w') as f:
+  ...     f.write(urllib2.urlopen(u).read())
+  $ unzip -t archive.zip
+  Archive:  archive.zip
+      testing: empty-default/.hg_archival.txt   OK
+      testing: empty-default/f1         OK
+  No errors detected in compressed data of archive.zip.
+
 test 'verify' with remotestore:
 
   $ rm "${USERCACHE}"/02a439e5c31c526465ab1a0ca1f431f76b827b90


failure mode:

@@ -225,7 +225,7 @@
   $ unzip -t archive.zip
   Archive:  archive.zip
       testing: empty-default/.hg_archival.txt   OK
-      testing: empty-default/f1         OK
+      testing: empty-default/.hglf/f1   OK
   No errors detected in compressed data of archive.zip.
 
 test 'verify' with remotestore:
Comment 4 Augie Fackler 2015-09-29 13:20 UTC
The first bad revision is:                                                                             
changeset:   32456:7699d3212994
user:        Matt Harbison <matt_harbison@yahoo.com>
date:        Sat Jul 11 23:26:33 2015 -0400
summary:     largefiles: allow the archiving of largefiles to be disabled


Just ran bisect because I got curious.
Comment 5 Pierre-Yves David 2015-09-29 20:02 UTC
"no longer" → regression
Comment 6 Matt Harbison 2015-09-29 21:18 UTC
(In reply to Augie Fackler from comment #3)

Thanks, I wasn't sure how to put together a test case for this.

The problem I'm having is that @webcommand and @command are different enough that extensions.wrapcommand() crashes, and the override is never called when using extensions.wrapfunction().  Any passing ideas to get around this, or code with similar needs that I can copy off of?
Comment 7 Matt Mackall 2015-10-18 15:26 UTC
Fixed by:

changeset:   30905:9a466b9f9792
branch:      stable
tag:         3.5.2
parent:      30901:aca296094a29
user:        Matt Harbison <matt_harbison@yahoo.com>
date:        Tue Sep 29 23:29:44 2015 -0400
summary:     largefiles: restore archiving largefiles with hgweb (issue4859)
Comment 8 Bugzilla 2015-10-27 00:00 UTC
Bug was set to TESTING for 8 days, resolving