tests/test-archive.t
author Pierre-Yves David <pierre-yves.david@octobus.net>
Fri, 15 Jan 2021 12:41:38 +0100
changeset 46314 95a615dd77bf
parent 45827 8d72e29ad1e0
child 46978 dc8976cc3a6e
permissions -rw-r--r--
clone: make sure we warm the cache after a clone This work around any deviciency/limitation of the clone process. In our case this ensure the persistent nodemap exist with valid content. Ideally, the cloning process would also do "the right thing". However since older server will never be able to do "the right thing". The local workaround will be necessary anyway. I am not worried by the performance impact of this as `hg clone` is non-instant on large repositories where is could matters. Warming the cache if they are already correct is very fast. And if they are not already warm, this seems like a good time to do so. This impact various test as more cache are now warmed sooner, all the change should be harmless. Differential Revision: https://phab.mercurial-scm.org/D9789
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
22046
7a9cbb315d84 tests: replace exit 80 with #require
Matt Mackall <mpm@selenic.com>
parents: 19870
diff changeset
     1
#require serve
15446
c5c9ca3719f9 tests: use 'hghave serve' to guard tests that requires serve daemon management
Mads Kiilerich <mads@kiilerich.com>
parents: 13956
diff changeset
     2
13956
ffb5c09ba822 tests: remove redundant mkdir
Martin Geisler <mg@lazybytes.net>
parents: 13149
diff changeset
     3
  $ hg init test
11853
afe19a1bf9d3 tests: unify test-archive
Martin Geisler <mg@lazybytes.net>
parents: 10650
diff changeset
     4
  $ cd test
afe19a1bf9d3 tests: unify test-archive
Martin Geisler <mg@lazybytes.net>
parents: 10650
diff changeset
     5
  $ echo foo>foo
afe19a1bf9d3 tests: unify test-archive
Martin Geisler <mg@lazybytes.net>
parents: 10650
diff changeset
     6
  $ hg commit -Am 1 -d '1 0'
afe19a1bf9d3 tests: unify test-archive
Martin Geisler <mg@lazybytes.net>
parents: 10650
diff changeset
     7
  adding foo
afe19a1bf9d3 tests: unify test-archive
Martin Geisler <mg@lazybytes.net>
parents: 10650
diff changeset
     8
  $ echo bar>bar
afe19a1bf9d3 tests: unify test-archive
Martin Geisler <mg@lazybytes.net>
parents: 10650
diff changeset
     9
  $ hg commit -Am 2 -d '2 0'
afe19a1bf9d3 tests: unify test-archive
Martin Geisler <mg@lazybytes.net>
parents: 10650
diff changeset
    10
  adding bar
afe19a1bf9d3 tests: unify test-archive
Martin Geisler <mg@lazybytes.net>
parents: 10650
diff changeset
    11
  $ mkdir baz
afe19a1bf9d3 tests: unify test-archive
Martin Geisler <mg@lazybytes.net>
parents: 10650
diff changeset
    12
  $ echo bletch>baz/bletch
afe19a1bf9d3 tests: unify test-archive
Martin Geisler <mg@lazybytes.net>
parents: 10650
diff changeset
    13
  $ hg commit -Am 3 -d '1000000000 0'
afe19a1bf9d3 tests: unify test-archive
Martin Geisler <mg@lazybytes.net>
parents: 10650
diff changeset
    14
  adding baz/bletch
23231
32dadb2637f4 tests: introduce a subrepository to test-archive.t
Matt Harbison <matt_harbison@yahoo.com>
parents: 22046
diff changeset
    15
  $ hg init subrepo
32dadb2637f4 tests: introduce a subrepository to test-archive.t
Matt Harbison <matt_harbison@yahoo.com>
parents: 22046
diff changeset
    16
  $ touch subrepo/sub
32dadb2637f4 tests: introduce a subrepository to test-archive.t
Matt Harbison <matt_harbison@yahoo.com>
parents: 22046
diff changeset
    17
  $ hg -q -R subrepo ci -Am "init subrepo"
32dadb2637f4 tests: introduce a subrepository to test-archive.t
Matt Harbison <matt_harbison@yahoo.com>
parents: 22046
diff changeset
    18
  $ echo "subrepo = subrepo" > .hgsub
32dadb2637f4 tests: introduce a subrepository to test-archive.t
Matt Harbison <matt_harbison@yahoo.com>
parents: 22046
diff changeset
    19
  $ hg add .hgsub
32dadb2637f4 tests: introduce a subrepository to test-archive.t
Matt Harbison <matt_harbison@yahoo.com>
parents: 22046
diff changeset
    20
  $ hg ci -m "add subrepo"
34815
68e0bcb90357 subrepo: share instead of clone if the parent repo is shared (issue5675) (BC)
Matt Harbison <matt_harbison@yahoo.com>
parents: 34654
diff changeset
    21
68e0bcb90357 subrepo: share instead of clone if the parent repo is shared (issue5675) (BC)
Matt Harbison <matt_harbison@yahoo.com>
parents: 34654
diff changeset
    22
  $ cat >> $HGRCPATH <<EOF
68e0bcb90357 subrepo: share instead of clone if the parent repo is shared (issue5675) (BC)
Matt Harbison <matt_harbison@yahoo.com>
parents: 34654
diff changeset
    23
  > [extensions]
68e0bcb90357 subrepo: share instead of clone if the parent repo is shared (issue5675) (BC)
Matt Harbison <matt_harbison@yahoo.com>
parents: 34654
diff changeset
    24
  > share =
68e0bcb90357 subrepo: share instead of clone if the parent repo is shared (issue5675) (BC)
Matt Harbison <matt_harbison@yahoo.com>
parents: 34654
diff changeset
    25
  > EOF
68e0bcb90357 subrepo: share instead of clone if the parent repo is shared (issue5675) (BC)
Matt Harbison <matt_harbison@yahoo.com>
parents: 34654
diff changeset
    26
68e0bcb90357 subrepo: share instead of clone if the parent repo is shared (issue5675) (BC)
Matt Harbison <matt_harbison@yahoo.com>
parents: 34654
diff changeset
    27
hg subrepos are shared when the parent repo is shared
68e0bcb90357 subrepo: share instead of clone if the parent repo is shared (issue5675) (BC)
Matt Harbison <matt_harbison@yahoo.com>
parents: 34654
diff changeset
    28
68e0bcb90357 subrepo: share instead of clone if the parent repo is shared (issue5675) (BC)
Matt Harbison <matt_harbison@yahoo.com>
parents: 34654
diff changeset
    29
  $ cd ..
68e0bcb90357 subrepo: share instead of clone if the parent repo is shared (issue5675) (BC)
Matt Harbison <matt_harbison@yahoo.com>
parents: 34654
diff changeset
    30
  $ hg share test shared1
68e0bcb90357 subrepo: share instead of clone if the parent repo is shared (issue5675) (BC)
Matt Harbison <matt_harbison@yahoo.com>
parents: 34654
diff changeset
    31
  updating working directory
68e0bcb90357 subrepo: share instead of clone if the parent repo is shared (issue5675) (BC)
Matt Harbison <matt_harbison@yahoo.com>
parents: 34654
diff changeset
    32
  sharing subrepo subrepo from $TESTTMP/test/subrepo
68e0bcb90357 subrepo: share instead of clone if the parent repo is shared (issue5675) (BC)
Matt Harbison <matt_harbison@yahoo.com>
parents: 34654
diff changeset
    33
  5 files updated, 0 files merged, 0 files removed, 0 files unresolved
68e0bcb90357 subrepo: share instead of clone if the parent repo is shared (issue5675) (BC)
Matt Harbison <matt_harbison@yahoo.com>
parents: 34654
diff changeset
    34
  $ cat shared1/subrepo/.hg/sharedpath
35393
4441705b7111 tests: remove (glob) annotations that were only for '\' matches
Matt Harbison <matt_harbison@yahoo.com>
parents: 34899
diff changeset
    35
  $TESTTMP/test/subrepo/.hg (no-eol)
34815
68e0bcb90357 subrepo: share instead of clone if the parent repo is shared (issue5675) (BC)
Matt Harbison <matt_harbison@yahoo.com>
parents: 34654
diff changeset
    36
68e0bcb90357 subrepo: share instead of clone if the parent repo is shared (issue5675) (BC)
Matt Harbison <matt_harbison@yahoo.com>
parents: 34654
diff changeset
    37
hg subrepos are shared into existence on demand if the parent was shared
68e0bcb90357 subrepo: share instead of clone if the parent repo is shared (issue5675) (BC)
Matt Harbison <matt_harbison@yahoo.com>
parents: 34654
diff changeset
    38
68e0bcb90357 subrepo: share instead of clone if the parent repo is shared (issue5675) (BC)
Matt Harbison <matt_harbison@yahoo.com>
parents: 34654
diff changeset
    39
  $ hg clone -qr 1 test clone1
68e0bcb90357 subrepo: share instead of clone if the parent repo is shared (issue5675) (BC)
Matt Harbison <matt_harbison@yahoo.com>
parents: 34654
diff changeset
    40
  $ hg share clone1 share2
68e0bcb90357 subrepo: share instead of clone if the parent repo is shared (issue5675) (BC)
Matt Harbison <matt_harbison@yahoo.com>
parents: 34654
diff changeset
    41
  updating working directory
68e0bcb90357 subrepo: share instead of clone if the parent repo is shared (issue5675) (BC)
Matt Harbison <matt_harbison@yahoo.com>
parents: 34654
diff changeset
    42
  2 files updated, 0 files merged, 0 files removed, 0 files unresolved
68e0bcb90357 subrepo: share instead of clone if the parent repo is shared (issue5675) (BC)
Matt Harbison <matt_harbison@yahoo.com>
parents: 34654
diff changeset
    43
  $ hg -R clone1 -q pull
68e0bcb90357 subrepo: share instead of clone if the parent repo is shared (issue5675) (BC)
Matt Harbison <matt_harbison@yahoo.com>
parents: 34654
diff changeset
    44
  $ hg -R share2 update tip
68e0bcb90357 subrepo: share instead of clone if the parent repo is shared (issue5675) (BC)
Matt Harbison <matt_harbison@yahoo.com>
parents: 34654
diff changeset
    45
  sharing subrepo subrepo from $TESTTMP/test/subrepo
68e0bcb90357 subrepo: share instead of clone if the parent repo is shared (issue5675) (BC)
Matt Harbison <matt_harbison@yahoo.com>
parents: 34654
diff changeset
    46
  3 files updated, 0 files merged, 0 files removed, 0 files unresolved
68e0bcb90357 subrepo: share instead of clone if the parent repo is shared (issue5675) (BC)
Matt Harbison <matt_harbison@yahoo.com>
parents: 34654
diff changeset
    47
  $ cat share2/subrepo/.hg/sharedpath
35393
4441705b7111 tests: remove (glob) annotations that were only for '\' matches
Matt Harbison <matt_harbison@yahoo.com>
parents: 34899
diff changeset
    48
  $TESTTMP/test/subrepo/.hg (no-eol)
34815
68e0bcb90357 subrepo: share instead of clone if the parent repo is shared (issue5675) (BC)
Matt Harbison <matt_harbison@yahoo.com>
parents: 34654
diff changeset
    49
  $ echo 'mod' > share2/subrepo/sub
68e0bcb90357 subrepo: share instead of clone if the parent repo is shared (issue5675) (BC)
Matt Harbison <matt_harbison@yahoo.com>
parents: 34654
diff changeset
    50
  $ hg -R share2 ci -Sqm 'subrepo mod'
68e0bcb90357 subrepo: share instead of clone if the parent repo is shared (issue5675) (BC)
Matt Harbison <matt_harbison@yahoo.com>
parents: 34654
diff changeset
    51
  $ hg -R clone1 update -C tip
68e0bcb90357 subrepo: share instead of clone if the parent repo is shared (issue5675) (BC)
Matt Harbison <matt_harbison@yahoo.com>
parents: 34654
diff changeset
    52
  cloning subrepo subrepo from $TESTTMP/test/subrepo
68e0bcb90357 subrepo: share instead of clone if the parent repo is shared (issue5675) (BC)
Matt Harbison <matt_harbison@yahoo.com>
parents: 34654
diff changeset
    53
  3 files updated, 0 files merged, 0 files removed, 0 files unresolved
34879
7d51a7792f52 subrepo: implement 'unshare' for Mercurial subrepos
Matt Harbison <matt_harbison@yahoo.com>
parents: 34815
diff changeset
    54
  $ find share2 | egrep 'sharedpath|00.+\.i' | sort
7d51a7792f52 subrepo: implement 'unshare' for Mercurial subrepos
Matt Harbison <matt_harbison@yahoo.com>
parents: 34815
diff changeset
    55
  share2/.hg/sharedpath
7d51a7792f52 subrepo: implement 'unshare' for Mercurial subrepos
Matt Harbison <matt_harbison@yahoo.com>
parents: 34815
diff changeset
    56
  share2/subrepo/.hg/sharedpath
7d51a7792f52 subrepo: implement 'unshare' for Mercurial subrepos
Matt Harbison <matt_harbison@yahoo.com>
parents: 34815
diff changeset
    57
  $ hg -R share2 unshare
7d51a7792f52 subrepo: implement 'unshare' for Mercurial subrepos
Matt Harbison <matt_harbison@yahoo.com>
parents: 34815
diff changeset
    58
  unsharing subrepo 'subrepo'
7d51a7792f52 subrepo: implement 'unshare' for Mercurial subrepos
Matt Harbison <matt_harbison@yahoo.com>
parents: 34815
diff changeset
    59
  $ find share2 | egrep 'sharedpath|00.+\.i' | sort
7d51a7792f52 subrepo: implement 'unshare' for Mercurial subrepos
Matt Harbison <matt_harbison@yahoo.com>
parents: 34815
diff changeset
    60
  share2/.hg/00changelog.i
7d51a7792f52 subrepo: implement 'unshare' for Mercurial subrepos
Matt Harbison <matt_harbison@yahoo.com>
parents: 34815
diff changeset
    61
  share2/.hg/sharedpath.old
7d51a7792f52 subrepo: implement 'unshare' for Mercurial subrepos
Matt Harbison <matt_harbison@yahoo.com>
parents: 34815
diff changeset
    62
  share2/.hg/store/00changelog.i
7d51a7792f52 subrepo: implement 'unshare' for Mercurial subrepos
Matt Harbison <matt_harbison@yahoo.com>
parents: 34815
diff changeset
    63
  share2/.hg/store/00manifest.i
7d51a7792f52 subrepo: implement 'unshare' for Mercurial subrepos
Matt Harbison <matt_harbison@yahoo.com>
parents: 34815
diff changeset
    64
  share2/subrepo/.hg/00changelog.i
7d51a7792f52 subrepo: implement 'unshare' for Mercurial subrepos
Matt Harbison <matt_harbison@yahoo.com>
parents: 34815
diff changeset
    65
  share2/subrepo/.hg/sharedpath.old
7d51a7792f52 subrepo: implement 'unshare' for Mercurial subrepos
Matt Harbison <matt_harbison@yahoo.com>
parents: 34815
diff changeset
    66
  share2/subrepo/.hg/store/00changelog.i
7d51a7792f52 subrepo: implement 'unshare' for Mercurial subrepos
Matt Harbison <matt_harbison@yahoo.com>
parents: 34815
diff changeset
    67
  share2/subrepo/.hg/store/00manifest.i
7d51a7792f52 subrepo: implement 'unshare' for Mercurial subrepos
Matt Harbison <matt_harbison@yahoo.com>
parents: 34815
diff changeset
    68
  $ hg -R share2/subrepo log -r tip -T compact
7d51a7792f52 subrepo: implement 'unshare' for Mercurial subrepos
Matt Harbison <matt_harbison@yahoo.com>
parents: 34815
diff changeset
    69
  1[tip]   559dcc9bfa65   1970-01-01 00:00 +0000   test
7d51a7792f52 subrepo: implement 'unshare' for Mercurial subrepos
Matt Harbison <matt_harbison@yahoo.com>
parents: 34815
diff changeset
    70
    subrepo mod
7d51a7792f52 subrepo: implement 'unshare' for Mercurial subrepos
Matt Harbison <matt_harbison@yahoo.com>
parents: 34815
diff changeset
    71
  
34815
68e0bcb90357 subrepo: share instead of clone if the parent repo is shared (issue5675) (BC)
Matt Harbison <matt_harbison@yahoo.com>
parents: 34654
diff changeset
    72
  $ rm -rf clone1
68e0bcb90357 subrepo: share instead of clone if the parent repo is shared (issue5675) (BC)
Matt Harbison <matt_harbison@yahoo.com>
parents: 34654
diff changeset
    73
68e0bcb90357 subrepo: share instead of clone if the parent repo is shared (issue5675) (BC)
Matt Harbison <matt_harbison@yahoo.com>
parents: 34654
diff changeset
    74
  $ hg clone -qr 1 test clone1
68e0bcb90357 subrepo: share instead of clone if the parent repo is shared (issue5675) (BC)
Matt Harbison <matt_harbison@yahoo.com>
parents: 34654
diff changeset
    75
  $ hg share clone1 shared3
68e0bcb90357 subrepo: share instead of clone if the parent repo is shared (issue5675) (BC)
Matt Harbison <matt_harbison@yahoo.com>
parents: 34654
diff changeset
    76
  updating working directory
68e0bcb90357 subrepo: share instead of clone if the parent repo is shared (issue5675) (BC)
Matt Harbison <matt_harbison@yahoo.com>
parents: 34654
diff changeset
    77
  2 files updated, 0 files merged, 0 files removed, 0 files unresolved
68e0bcb90357 subrepo: share instead of clone if the parent repo is shared (issue5675) (BC)
Matt Harbison <matt_harbison@yahoo.com>
parents: 34654
diff changeset
    78
  $ hg -R clone1 -q pull
68e0bcb90357 subrepo: share instead of clone if the parent repo is shared (issue5675) (BC)
Matt Harbison <matt_harbison@yahoo.com>
parents: 34654
diff changeset
    79
  $ hg -R shared3 archive --config ui.archivemeta=False -r tip -S archive
68e0bcb90357 subrepo: share instead of clone if the parent repo is shared (issue5675) (BC)
Matt Harbison <matt_harbison@yahoo.com>
parents: 34654
diff changeset
    80
  sharing subrepo subrepo from $TESTTMP/test/subrepo
68e0bcb90357 subrepo: share instead of clone if the parent repo is shared (issue5675) (BC)
Matt Harbison <matt_harbison@yahoo.com>
parents: 34654
diff changeset
    81
  $ cat shared3/subrepo/.hg/sharedpath
35393
4441705b7111 tests: remove (glob) annotations that were only for '\' matches
Matt Harbison <matt_harbison@yahoo.com>
parents: 34899
diff changeset
    82
  $TESTTMP/test/subrepo/.hg (no-eol)
34815
68e0bcb90357 subrepo: share instead of clone if the parent repo is shared (issue5675) (BC)
Matt Harbison <matt_harbison@yahoo.com>
parents: 34654
diff changeset
    83
  $ diff -r archive test
68e0bcb90357 subrepo: share instead of clone if the parent repo is shared (issue5675) (BC)
Matt Harbison <matt_harbison@yahoo.com>
parents: 34654
diff changeset
    84
  Only in test: .hg
34899
1e2dc50da17b tests: add some (?) output lines to catch "helpful" output from Solaris diff
Augie Fackler <augie@google.com>
parents: 34879
diff changeset
    85
  Common subdirectories: archive/baz and test/baz (?)
1e2dc50da17b tests: add some (?) output lines to catch "helpful" output from Solaris diff
Augie Fackler <augie@google.com>
parents: 34879
diff changeset
    86
  Common subdirectories: archive/subrepo and test/subrepo (?)
34815
68e0bcb90357 subrepo: share instead of clone if the parent repo is shared (issue5675) (BC)
Matt Harbison <matt_harbison@yahoo.com>
parents: 34654
diff changeset
    87
  Only in test/subrepo: .hg
68e0bcb90357 subrepo: share instead of clone if the parent repo is shared (issue5675) (BC)
Matt Harbison <matt_harbison@yahoo.com>
parents: 34654
diff changeset
    88
  [1]
68e0bcb90357 subrepo: share instead of clone if the parent repo is shared (issue5675) (BC)
Matt Harbison <matt_harbison@yahoo.com>
parents: 34654
diff changeset
    89
  $ rm -rf archive
68e0bcb90357 subrepo: share instead of clone if the parent repo is shared (issue5675) (BC)
Matt Harbison <matt_harbison@yahoo.com>
parents: 34654
diff changeset
    90
68e0bcb90357 subrepo: share instead of clone if the parent repo is shared (issue5675) (BC)
Matt Harbison <matt_harbison@yahoo.com>
parents: 34654
diff changeset
    91
  $ cd test
11853
afe19a1bf9d3 tests: unify test-archive
Martin Geisler <mg@lazybytes.net>
parents: 10650
diff changeset
    92
  $ echo "[web]" >> .hg/hgrc
afe19a1bf9d3 tests: unify test-archive
Martin Geisler <mg@lazybytes.net>
parents: 10650
diff changeset
    93
  $ echo "name = test-archive" >> .hg/hgrc
23232
a0ccb66f344d hgweb: fix a crash when using web.archivesubrepos
Matt Harbison <matt_harbison@yahoo.com>
parents: 23231
diff changeset
    94
  $ echo "archivesubrepos = True" >> .hg/hgrc
11853
afe19a1bf9d3 tests: unify test-archive
Martin Geisler <mg@lazybytes.net>
parents: 10650
diff changeset
    95
  $ cp .hg/hgrc .hg/hgrc-base
afe19a1bf9d3 tests: unify test-archive
Martin Geisler <mg@lazybytes.net>
parents: 10650
diff changeset
    96
  > test_archtype() {
38215
f715faeaceee config: rename allow_archive to allow-archive
David Demelier <markand@malikania.fr>
parents: 37009
diff changeset
    97
  >     echo "allow-archive = $1" >> .hg/hgrc
34654
4182d2065e7a configitems: drop redundant default of web.allow<archtype>
Yuya Nishihara <yuya@tcha.org>
parents: 33944
diff changeset
    98
  >     test_archtype_run "$@"
4182d2065e7a configitems: drop redundant default of web.allow<archtype>
Yuya Nishihara <yuya@tcha.org>
parents: 33944
diff changeset
    99
  > }
4182d2065e7a configitems: drop redundant default of web.allow<archtype>
Yuya Nishihara <yuya@tcha.org>
parents: 33944
diff changeset
   100
  > test_archtype_deprecated() {
4182d2065e7a configitems: drop redundant default of web.allow<archtype>
Yuya Nishihara <yuya@tcha.org>
parents: 33944
diff changeset
   101
  >     echo "allow$1 = True" >> .hg/hgrc
4182d2065e7a configitems: drop redundant default of web.allow<archtype>
Yuya Nishihara <yuya@tcha.org>
parents: 33944
diff changeset
   102
  >     test_archtype_run "$@"
4182d2065e7a configitems: drop redundant default of web.allow<archtype>
Yuya Nishihara <yuya@tcha.org>
parents: 33944
diff changeset
   103
  > }
4182d2065e7a configitems: drop redundant default of web.allow<archtype>
Yuya Nishihara <yuya@tcha.org>
parents: 33944
diff changeset
   104
  > test_archtype_run() {
4182d2065e7a configitems: drop redundant default of web.allow<archtype>
Yuya Nishihara <yuya@tcha.org>
parents: 33944
diff changeset
   105
  >     hg serve -p $HGPORT -d --pid-file=hg.pid -E errors.log \
4182d2065e7a configitems: drop redundant default of web.allow<archtype>
Yuya Nishihara <yuya@tcha.org>
parents: 33944
diff changeset
   106
  >         --config extensions.blackbox= --config blackbox.track=develwarn
11853
afe19a1bf9d3 tests: unify test-archive
Martin Geisler <mg@lazybytes.net>
parents: 10650
diff changeset
   107
  >     cat hg.pid >> $DAEMON_PIDS
afe19a1bf9d3 tests: unify test-archive
Martin Geisler <mg@lazybytes.net>
parents: 10650
diff changeset
   108
  >     echo % $1 allowed should give 200
36874
40193f977a8b tests: additional test coverage of archive web command
Gregory Szorc <gregory.szorc@gmail.com>
parents: 35393
diff changeset
   109
  >     get-with-headers.py --bodyfile body localhost:$HGPORT "archive/tip.$2" -
40193f977a8b tests: additional test coverage of archive web command
Gregory Szorc <gregory.szorc@gmail.com>
parents: 35393
diff changeset
   110
  >     f --size --sha1 body
11853
afe19a1bf9d3 tests: unify test-archive
Martin Geisler <mg@lazybytes.net>
parents: 10650
diff changeset
   111
  >     echo % $3 and $4 disallowed should both give 403
36874
40193f977a8b tests: additional test coverage of archive web command
Gregory Szorc <gregory.szorc@gmail.com>
parents: 35393
diff changeset
   112
  >     get-with-headers.py --bodyfile body localhost:$HGPORT "archive/tip.$3" -
40193f977a8b tests: additional test coverage of archive web command
Gregory Szorc <gregory.szorc@gmail.com>
parents: 35393
diff changeset
   113
  >     f --size --sha1 body
40193f977a8b tests: additional test coverage of archive web command
Gregory Szorc <gregory.szorc@gmail.com>
parents: 35393
diff changeset
   114
  >     get-with-headers.py --bodyfile body localhost:$HGPORT "archive/tip.$4" -
40193f977a8b tests: additional test coverage of archive web command
Gregory Szorc <gregory.szorc@gmail.com>
parents: 35393
diff changeset
   115
  >     f --size --sha1 body
25474
8c14f87bd0ae tests: drop DAEMON_PIDS from killdaemons calls
Matt Mackall <mpm@selenic.com>
parents: 25472
diff changeset
   116
  >     killdaemons.py
11853
afe19a1bf9d3 tests: unify test-archive
Martin Geisler <mg@lazybytes.net>
parents: 10650
diff changeset
   117
  >     cat errors.log
34654
4182d2065e7a configitems: drop redundant default of web.allow<archtype>
Yuya Nishihara <yuya@tcha.org>
parents: 33944
diff changeset
   118
  >     hg blackbox --config extensions.blackbox= --config blackbox.track=
11853
afe19a1bf9d3 tests: unify test-archive
Martin Geisler <mg@lazybytes.net>
parents: 10650
diff changeset
   119
  >     cp .hg/hgrc-base .hg/hgrc
afe19a1bf9d3 tests: unify test-archive
Martin Geisler <mg@lazybytes.net>
parents: 10650
diff changeset
   120
  > }
1166
bd66294b7a9b Added test case for zip/gz/bz2 archive downloads.
Thomas Arendsen Hein <thomas@intevation.de>
parents:
diff changeset
   121
11853
afe19a1bf9d3 tests: unify test-archive
Martin Geisler <mg@lazybytes.net>
parents: 10650
diff changeset
   122
check http return codes
afe19a1bf9d3 tests: unify test-archive
Martin Geisler <mg@lazybytes.net>
parents: 10650
diff changeset
   123
afe19a1bf9d3 tests: unify test-archive
Martin Geisler <mg@lazybytes.net>
parents: 10650
diff changeset
   124
  $ test_archtype gz tar.gz tar.bz2 zip
afe19a1bf9d3 tests: unify test-archive
Martin Geisler <mg@lazybytes.net>
parents: 10650
diff changeset
   125
  % gz allowed should give 200
afe19a1bf9d3 tests: unify test-archive
Martin Geisler <mg@lazybytes.net>
parents: 10650
diff changeset
   126
  200 Script output follows
36874
40193f977a8b tests: additional test coverage of archive web command
Gregory Szorc <gregory.szorc@gmail.com>
parents: 35393
diff changeset
   127
  content-disposition: attachment; filename=test-archive-1701ef1f1510.tar.gz
40193f977a8b tests: additional test coverage of archive web command
Gregory Szorc <gregory.szorc@gmail.com>
parents: 35393
diff changeset
   128
  content-type: application/x-gzip
37008
16203c6079e7 tests: use $HTTP_DATE$ for Date header
Gregory Szorc <gregory.szorc@gmail.com>
parents: 36874
diff changeset
   129
  date: $HTTP_DATE$
36874
40193f977a8b tests: additional test coverage of archive web command
Gregory Szorc <gregory.szorc@gmail.com>
parents: 35393
diff changeset
   130
  etag: W/"*" (glob)
37009
5890e5872f36 hgweb: allow defining Server response header for HTTP server
Gregory Szorc <gregory.szorc@gmail.com>
parents: 37008
diff changeset
   131
  server: testing stub value
36874
40193f977a8b tests: additional test coverage of archive web command
Gregory Szorc <gregory.szorc@gmail.com>
parents: 35393
diff changeset
   132
  transfer-encoding: chunked
40193f977a8b tests: additional test coverage of archive web command
Gregory Szorc <gregory.szorc@gmail.com>
parents: 35393
diff changeset
   133
  
43071
830eacef67f8 tests: make tarball output conditional on Python version
Gregory Szorc <gregory.szorc@gmail.com>
parents: 42940
diff changeset
   134
  body: size=408, sha1=8fa06531bddecc365a9f5edb0f88b65974bfe505 (no-py38 !)
44606
862025f108c7 tests: update test-archive.t expectations for python3.9 changes
Augie Fackler <augie@google.com>
parents: 43699
diff changeset
   135
  body: size=506, sha1=70926a04cb8887d0bcccf5380488100a10222def (py38 no-py39 !)
862025f108c7 tests: update test-archive.t expectations for python3.9 changes
Augie Fackler <augie@google.com>
parents: 43699
diff changeset
   136
  body: size=505, sha1=eb823c293bedff0df4070b854e2c5cbb06d6ec62 (py39 !)
11853
afe19a1bf9d3 tests: unify test-archive
Martin Geisler <mg@lazybytes.net>
parents: 10650
diff changeset
   137
  % tar.bz2 and zip disallowed should both give 403
afe19a1bf9d3 tests: unify test-archive
Martin Geisler <mg@lazybytes.net>
parents: 10650
diff changeset
   138
  403 Archive type not allowed: bz2
36874
40193f977a8b tests: additional test coverage of archive web command
Gregory Szorc <gregory.szorc@gmail.com>
parents: 35393
diff changeset
   139
  content-type: text/html; charset=ascii
37008
16203c6079e7 tests: use $HTTP_DATE$ for Date header
Gregory Szorc <gregory.szorc@gmail.com>
parents: 36874
diff changeset
   140
  date: $HTTP_DATE$
36874
40193f977a8b tests: additional test coverage of archive web command
Gregory Szorc <gregory.szorc@gmail.com>
parents: 35393
diff changeset
   141
  etag: W/"*" (glob)
37009
5890e5872f36 hgweb: allow defining Server response header for HTTP server
Gregory Szorc <gregory.szorc@gmail.com>
parents: 37008
diff changeset
   142
  server: testing stub value
36874
40193f977a8b tests: additional test coverage of archive web command
Gregory Szorc <gregory.szorc@gmail.com>
parents: 35393
diff changeset
   143
  transfer-encoding: chunked
40193f977a8b tests: additional test coverage of archive web command
Gregory Szorc <gregory.szorc@gmail.com>
parents: 35393
diff changeset
   144
  
40193f977a8b tests: additional test coverage of archive web command
Gregory Szorc <gregory.szorc@gmail.com>
parents: 35393
diff changeset
   145
  body: size=1451, sha1=4c5cf0f574446c44feb7f88f4e0e2a56bd92c352
11853
afe19a1bf9d3 tests: unify test-archive
Martin Geisler <mg@lazybytes.net>
parents: 10650
diff changeset
   146
  403 Archive type not allowed: zip
36874
40193f977a8b tests: additional test coverage of archive web command
Gregory Szorc <gregory.szorc@gmail.com>
parents: 35393
diff changeset
   147
  content-type: text/html; charset=ascii
37008
16203c6079e7 tests: use $HTTP_DATE$ for Date header
Gregory Szorc <gregory.szorc@gmail.com>
parents: 36874
diff changeset
   148
  date: $HTTP_DATE$
36874
40193f977a8b tests: additional test coverage of archive web command
Gregory Szorc <gregory.szorc@gmail.com>
parents: 35393
diff changeset
   149
  etag: W/"*" (glob)
37009
5890e5872f36 hgweb: allow defining Server response header for HTTP server
Gregory Szorc <gregory.szorc@gmail.com>
parents: 37008
diff changeset
   150
  server: testing stub value
36874
40193f977a8b tests: additional test coverage of archive web command
Gregory Szorc <gregory.szorc@gmail.com>
parents: 35393
diff changeset
   151
  transfer-encoding: chunked
40193f977a8b tests: additional test coverage of archive web command
Gregory Szorc <gregory.szorc@gmail.com>
parents: 35393
diff changeset
   152
  
40193f977a8b tests: additional test coverage of archive web command
Gregory Szorc <gregory.szorc@gmail.com>
parents: 35393
diff changeset
   153
  body: size=1451, sha1=cbfa5574b337348bfd0564cc534474d002e7d6c7
11853
afe19a1bf9d3 tests: unify test-archive
Martin Geisler <mg@lazybytes.net>
parents: 10650
diff changeset
   154
  $ test_archtype bz2 tar.bz2 zip tar.gz
afe19a1bf9d3 tests: unify test-archive
Martin Geisler <mg@lazybytes.net>
parents: 10650
diff changeset
   155
  % bz2 allowed should give 200
afe19a1bf9d3 tests: unify test-archive
Martin Geisler <mg@lazybytes.net>
parents: 10650
diff changeset
   156
  200 Script output follows
36874
40193f977a8b tests: additional test coverage of archive web command
Gregory Szorc <gregory.szorc@gmail.com>
parents: 35393
diff changeset
   157
  content-disposition: attachment; filename=test-archive-1701ef1f1510.tar.bz2
40193f977a8b tests: additional test coverage of archive web command
Gregory Szorc <gregory.szorc@gmail.com>
parents: 35393
diff changeset
   158
  content-type: application/x-bzip2
37008
16203c6079e7 tests: use $HTTP_DATE$ for Date header
Gregory Szorc <gregory.szorc@gmail.com>
parents: 36874
diff changeset
   159
  date: $HTTP_DATE$
36874
40193f977a8b tests: additional test coverage of archive web command
Gregory Szorc <gregory.szorc@gmail.com>
parents: 35393
diff changeset
   160
  etag: W/"*" (glob)
37009
5890e5872f36 hgweb: allow defining Server response header for HTTP server
Gregory Szorc <gregory.szorc@gmail.com>
parents: 37008
diff changeset
   161
  server: testing stub value
36874
40193f977a8b tests: additional test coverage of archive web command
Gregory Szorc <gregory.szorc@gmail.com>
parents: 35393
diff changeset
   162
  transfer-encoding: chunked
40193f977a8b tests: additional test coverage of archive web command
Gregory Szorc <gregory.szorc@gmail.com>
parents: 35393
diff changeset
   163
  
43071
830eacef67f8 tests: make tarball output conditional on Python version
Gregory Szorc <gregory.szorc@gmail.com>
parents: 42940
diff changeset
   164
  body: size=426, sha1=8d87f5aba6e14f1bfea6c232985982c278b2fb0b (no-py38 !)
44606
862025f108c7 tests: update test-archive.t expectations for python3.9 changes
Augie Fackler <augie@google.com>
parents: 43699
diff changeset
   165
  body: size=506, sha1=1bd1f8e8d3701704bd4385038bd9c09b81c77f4e (py38 no-py39 !)
862025f108c7 tests: update test-archive.t expectations for python3.9 changes
Augie Fackler <augie@google.com>
parents: 43699
diff changeset
   166
  body: size=503, sha1=2d8ce8bb3816603b9683a1804a5a02c11224cb01 (py39 !)
11853
afe19a1bf9d3 tests: unify test-archive
Martin Geisler <mg@lazybytes.net>
parents: 10650
diff changeset
   167
  % zip and tar.gz disallowed should both give 403
afe19a1bf9d3 tests: unify test-archive
Martin Geisler <mg@lazybytes.net>
parents: 10650
diff changeset
   168
  403 Archive type not allowed: zip
36874
40193f977a8b tests: additional test coverage of archive web command
Gregory Szorc <gregory.szorc@gmail.com>
parents: 35393
diff changeset
   169
  content-type: text/html; charset=ascii
37008
16203c6079e7 tests: use $HTTP_DATE$ for Date header
Gregory Szorc <gregory.szorc@gmail.com>
parents: 36874
diff changeset
   170
  date: $HTTP_DATE$
36874
40193f977a8b tests: additional test coverage of archive web command
Gregory Szorc <gregory.szorc@gmail.com>
parents: 35393
diff changeset
   171
  etag: W/"*" (glob)
37009
5890e5872f36 hgweb: allow defining Server response header for HTTP server
Gregory Szorc <gregory.szorc@gmail.com>
parents: 37008
diff changeset
   172
  server: testing stub value
36874
40193f977a8b tests: additional test coverage of archive web command
Gregory Szorc <gregory.szorc@gmail.com>
parents: 35393
diff changeset
   173
  transfer-encoding: chunked
40193f977a8b tests: additional test coverage of archive web command
Gregory Szorc <gregory.szorc@gmail.com>
parents: 35393
diff changeset
   174
  
40193f977a8b tests: additional test coverage of archive web command
Gregory Szorc <gregory.szorc@gmail.com>
parents: 35393
diff changeset
   175
  body: size=1451, sha1=cbfa5574b337348bfd0564cc534474d002e7d6c7
11853
afe19a1bf9d3 tests: unify test-archive
Martin Geisler <mg@lazybytes.net>
parents: 10650
diff changeset
   176
  403 Archive type not allowed: gz
36874
40193f977a8b tests: additional test coverage of archive web command
Gregory Szorc <gregory.szorc@gmail.com>
parents: 35393
diff changeset
   177
  content-type: text/html; charset=ascii
37008
16203c6079e7 tests: use $HTTP_DATE$ for Date header
Gregory Szorc <gregory.szorc@gmail.com>
parents: 36874
diff changeset
   178
  date: $HTTP_DATE$
36874
40193f977a8b tests: additional test coverage of archive web command
Gregory Szorc <gregory.szorc@gmail.com>
parents: 35393
diff changeset
   179
  etag: W/"*" (glob)
37009
5890e5872f36 hgweb: allow defining Server response header for HTTP server
Gregory Szorc <gregory.szorc@gmail.com>
parents: 37008
diff changeset
   180
  server: testing stub value
36874
40193f977a8b tests: additional test coverage of archive web command
Gregory Szorc <gregory.szorc@gmail.com>
parents: 35393
diff changeset
   181
  transfer-encoding: chunked
40193f977a8b tests: additional test coverage of archive web command
Gregory Szorc <gregory.szorc@gmail.com>
parents: 35393
diff changeset
   182
  
40193f977a8b tests: additional test coverage of archive web command
Gregory Szorc <gregory.szorc@gmail.com>
parents: 35393
diff changeset
   183
  body: size=1450, sha1=71f0b12d59f85fdcfe8ff493e2dc66863f2f7734
11853
afe19a1bf9d3 tests: unify test-archive
Martin Geisler <mg@lazybytes.net>
parents: 10650
diff changeset
   184
  $ test_archtype zip zip tar.gz tar.bz2
afe19a1bf9d3 tests: unify test-archive
Martin Geisler <mg@lazybytes.net>
parents: 10650
diff changeset
   185
  % zip allowed should give 200
afe19a1bf9d3 tests: unify test-archive
Martin Geisler <mg@lazybytes.net>
parents: 10650
diff changeset
   186
  200 Script output follows
36874
40193f977a8b tests: additional test coverage of archive web command
Gregory Szorc <gregory.szorc@gmail.com>
parents: 35393
diff changeset
   187
  content-disposition: attachment; filename=test-archive-1701ef1f1510.zip
40193f977a8b tests: additional test coverage of archive web command
Gregory Szorc <gregory.szorc@gmail.com>
parents: 35393
diff changeset
   188
  content-type: application/zip
37008
16203c6079e7 tests: use $HTTP_DATE$ for Date header
Gregory Szorc <gregory.szorc@gmail.com>
parents: 36874
diff changeset
   189
  date: $HTTP_DATE$
36874
40193f977a8b tests: additional test coverage of archive web command
Gregory Szorc <gregory.szorc@gmail.com>
parents: 35393
diff changeset
   190
  etag: W/"*" (glob)
37009
5890e5872f36 hgweb: allow defining Server response header for HTTP server
Gregory Szorc <gregory.szorc@gmail.com>
parents: 37008
diff changeset
   191
  server: testing stub value
36874
40193f977a8b tests: additional test coverage of archive web command
Gregory Szorc <gregory.szorc@gmail.com>
parents: 35393
diff changeset
   192
  transfer-encoding: chunked
40193f977a8b tests: additional test coverage of archive web command
Gregory Szorc <gregory.szorc@gmail.com>
parents: 35393
diff changeset
   193
  
41316
8df3471931cc tests: add size and hash for Python 3
Gregory Szorc <gregory.szorc@gmail.com>
parents: 40305
diff changeset
   194
  body: size=(1377|1461|1489), sha1=(677b14d3d048778d5eb5552c14a67e6192068650|be6d3983aa13dfe930361b2569291cdedd02b537|1897e496871aa89ad685a92b936f5fa0d008b9e8) (re)
11853
afe19a1bf9d3 tests: unify test-archive
Martin Geisler <mg@lazybytes.net>
parents: 10650
diff changeset
   195
  % tar.gz and tar.bz2 disallowed should both give 403
afe19a1bf9d3 tests: unify test-archive
Martin Geisler <mg@lazybytes.net>
parents: 10650
diff changeset
   196
  403 Archive type not allowed: gz
36874
40193f977a8b tests: additional test coverage of archive web command
Gregory Szorc <gregory.szorc@gmail.com>
parents: 35393
diff changeset
   197
  content-type: text/html; charset=ascii
37008
16203c6079e7 tests: use $HTTP_DATE$ for Date header
Gregory Szorc <gregory.szorc@gmail.com>
parents: 36874
diff changeset
   198
  date: $HTTP_DATE$
36874
40193f977a8b tests: additional test coverage of archive web command
Gregory Szorc <gregory.szorc@gmail.com>
parents: 35393
diff changeset
   199
  etag: W/"*" (glob)
37009
5890e5872f36 hgweb: allow defining Server response header for HTTP server
Gregory Szorc <gregory.szorc@gmail.com>
parents: 37008
diff changeset
   200
  server: testing stub value
36874
40193f977a8b tests: additional test coverage of archive web command
Gregory Szorc <gregory.szorc@gmail.com>
parents: 35393
diff changeset
   201
  transfer-encoding: chunked
40193f977a8b tests: additional test coverage of archive web command
Gregory Szorc <gregory.szorc@gmail.com>
parents: 35393
diff changeset
   202
  
40193f977a8b tests: additional test coverage of archive web command
Gregory Szorc <gregory.szorc@gmail.com>
parents: 35393
diff changeset
   203
  body: size=1450, sha1=71f0b12d59f85fdcfe8ff493e2dc66863f2f7734
11853
afe19a1bf9d3 tests: unify test-archive
Martin Geisler <mg@lazybytes.net>
parents: 10650
diff changeset
   204
  403 Archive type not allowed: bz2
36874
40193f977a8b tests: additional test coverage of archive web command
Gregory Szorc <gregory.szorc@gmail.com>
parents: 35393
diff changeset
   205
  content-type: text/html; charset=ascii
37008
16203c6079e7 tests: use $HTTP_DATE$ for Date header
Gregory Szorc <gregory.szorc@gmail.com>
parents: 36874
diff changeset
   206
  date: $HTTP_DATE$
36874
40193f977a8b tests: additional test coverage of archive web command
Gregory Szorc <gregory.szorc@gmail.com>
parents: 35393
diff changeset
   207
  etag: W/"*" (glob)
37009
5890e5872f36 hgweb: allow defining Server response header for HTTP server
Gregory Szorc <gregory.szorc@gmail.com>
parents: 37008
diff changeset
   208
  server: testing stub value
36874
40193f977a8b tests: additional test coverage of archive web command
Gregory Szorc <gregory.szorc@gmail.com>
parents: 35393
diff changeset
   209
  transfer-encoding: chunked
40193f977a8b tests: additional test coverage of archive web command
Gregory Szorc <gregory.szorc@gmail.com>
parents: 35393
diff changeset
   210
  
40193f977a8b tests: additional test coverage of archive web command
Gregory Szorc <gregory.szorc@gmail.com>
parents: 35393
diff changeset
   211
  body: size=1451, sha1=4c5cf0f574446c44feb7f88f4e0e2a56bd92c352
7029
b84d27386285 hgweb: Respond with HTTP 403 for disabled archive types instead of 404
Rocco Rutte <pdmef@gmx.net>
parents: 6496
diff changeset
   212
34654
4182d2065e7a configitems: drop redundant default of web.allow<archtype>
Yuya Nishihara <yuya@tcha.org>
parents: 33944
diff changeset
   213
check http return codes (with deprecated option)
4182d2065e7a configitems: drop redundant default of web.allow<archtype>
Yuya Nishihara <yuya@tcha.org>
parents: 33944
diff changeset
   214
4182d2065e7a configitems: drop redundant default of web.allow<archtype>
Yuya Nishihara <yuya@tcha.org>
parents: 33944
diff changeset
   215
  $ test_archtype_deprecated gz tar.gz tar.bz2 zip
4182d2065e7a configitems: drop redundant default of web.allow<archtype>
Yuya Nishihara <yuya@tcha.org>
parents: 33944
diff changeset
   216
  % gz allowed should give 200
4182d2065e7a configitems: drop redundant default of web.allow<archtype>
Yuya Nishihara <yuya@tcha.org>
parents: 33944
diff changeset
   217
  200 Script output follows
36874
40193f977a8b tests: additional test coverage of archive web command
Gregory Szorc <gregory.szorc@gmail.com>
parents: 35393
diff changeset
   218
  content-disposition: attachment; filename=test-archive-1701ef1f1510.tar.gz
40193f977a8b tests: additional test coverage of archive web command
Gregory Szorc <gregory.szorc@gmail.com>
parents: 35393
diff changeset
   219
  content-type: application/x-gzip
37008
16203c6079e7 tests: use $HTTP_DATE$ for Date header
Gregory Szorc <gregory.szorc@gmail.com>
parents: 36874
diff changeset
   220
  date: $HTTP_DATE$
36874
40193f977a8b tests: additional test coverage of archive web command
Gregory Szorc <gregory.szorc@gmail.com>
parents: 35393
diff changeset
   221
  etag: W/"*" (glob)
37009
5890e5872f36 hgweb: allow defining Server response header for HTTP server
Gregory Szorc <gregory.szorc@gmail.com>
parents: 37008
diff changeset
   222
  server: testing stub value
36874
40193f977a8b tests: additional test coverage of archive web command
Gregory Szorc <gregory.szorc@gmail.com>
parents: 35393
diff changeset
   223
  transfer-encoding: chunked
40193f977a8b tests: additional test coverage of archive web command
Gregory Szorc <gregory.szorc@gmail.com>
parents: 35393
diff changeset
   224
  
43071
830eacef67f8 tests: make tarball output conditional on Python version
Gregory Szorc <gregory.szorc@gmail.com>
parents: 42940
diff changeset
   225
  body: size=408, sha1=8fa06531bddecc365a9f5edb0f88b65974bfe505 (no-py38 !)
44606
862025f108c7 tests: update test-archive.t expectations for python3.9 changes
Augie Fackler <augie@google.com>
parents: 43699
diff changeset
   226
  body: size=506, sha1=70926a04cb8887d0bcccf5380488100a10222def (py38 no-py39 !)
862025f108c7 tests: update test-archive.t expectations for python3.9 changes
Augie Fackler <augie@google.com>
parents: 43699
diff changeset
   227
  body: size=505, sha1=eb823c293bedff0df4070b854e2c5cbb06d6ec62 (py39 !)
34654
4182d2065e7a configitems: drop redundant default of web.allow<archtype>
Yuya Nishihara <yuya@tcha.org>
parents: 33944
diff changeset
   228
  % tar.bz2 and zip disallowed should both give 403
4182d2065e7a configitems: drop redundant default of web.allow<archtype>
Yuya Nishihara <yuya@tcha.org>
parents: 33944
diff changeset
   229
  403 Archive type not allowed: bz2
36874
40193f977a8b tests: additional test coverage of archive web command
Gregory Szorc <gregory.szorc@gmail.com>
parents: 35393
diff changeset
   230
  content-type: text/html; charset=ascii
37008
16203c6079e7 tests: use $HTTP_DATE$ for Date header
Gregory Szorc <gregory.szorc@gmail.com>
parents: 36874
diff changeset
   231
  date: $HTTP_DATE$
36874
40193f977a8b tests: additional test coverage of archive web command
Gregory Szorc <gregory.szorc@gmail.com>
parents: 35393
diff changeset
   232
  etag: W/"*" (glob)
37009
5890e5872f36 hgweb: allow defining Server response header for HTTP server
Gregory Szorc <gregory.szorc@gmail.com>
parents: 37008
diff changeset
   233
  server: testing stub value
36874
40193f977a8b tests: additional test coverage of archive web command
Gregory Szorc <gregory.szorc@gmail.com>
parents: 35393
diff changeset
   234
  transfer-encoding: chunked
40193f977a8b tests: additional test coverage of archive web command
Gregory Szorc <gregory.szorc@gmail.com>
parents: 35393
diff changeset
   235
  
40193f977a8b tests: additional test coverage of archive web command
Gregory Szorc <gregory.szorc@gmail.com>
parents: 35393
diff changeset
   236
  body: size=1451, sha1=4c5cf0f574446c44feb7f88f4e0e2a56bd92c352
34654
4182d2065e7a configitems: drop redundant default of web.allow<archtype>
Yuya Nishihara <yuya@tcha.org>
parents: 33944
diff changeset
   237
  403 Archive type not allowed: zip
36874
40193f977a8b tests: additional test coverage of archive web command
Gregory Szorc <gregory.szorc@gmail.com>
parents: 35393
diff changeset
   238
  content-type: text/html; charset=ascii
37008
16203c6079e7 tests: use $HTTP_DATE$ for Date header
Gregory Szorc <gregory.szorc@gmail.com>
parents: 36874
diff changeset
   239
  date: $HTTP_DATE$
36874
40193f977a8b tests: additional test coverage of archive web command
Gregory Szorc <gregory.szorc@gmail.com>
parents: 35393
diff changeset
   240
  etag: W/"*" (glob)
37009
5890e5872f36 hgweb: allow defining Server response header for HTTP server
Gregory Szorc <gregory.szorc@gmail.com>
parents: 37008
diff changeset
   241
  server: testing stub value
36874
40193f977a8b tests: additional test coverage of archive web command
Gregory Szorc <gregory.szorc@gmail.com>
parents: 35393
diff changeset
   242
  transfer-encoding: chunked
40193f977a8b tests: additional test coverage of archive web command
Gregory Szorc <gregory.szorc@gmail.com>
parents: 35393
diff changeset
   243
  
40193f977a8b tests: additional test coverage of archive web command
Gregory Szorc <gregory.szorc@gmail.com>
parents: 35393
diff changeset
   244
  body: size=1451, sha1=cbfa5574b337348bfd0564cc534474d002e7d6c7
34654
4182d2065e7a configitems: drop redundant default of web.allow<archtype>
Yuya Nishihara <yuya@tcha.org>
parents: 33944
diff changeset
   245
  $ test_archtype_deprecated bz2 tar.bz2 zip tar.gz
4182d2065e7a configitems: drop redundant default of web.allow<archtype>
Yuya Nishihara <yuya@tcha.org>
parents: 33944
diff changeset
   246
  % bz2 allowed should give 200
4182d2065e7a configitems: drop redundant default of web.allow<archtype>
Yuya Nishihara <yuya@tcha.org>
parents: 33944
diff changeset
   247
  200 Script output follows
36874
40193f977a8b tests: additional test coverage of archive web command
Gregory Szorc <gregory.szorc@gmail.com>
parents: 35393
diff changeset
   248
  content-disposition: attachment; filename=test-archive-1701ef1f1510.tar.bz2
40193f977a8b tests: additional test coverage of archive web command
Gregory Szorc <gregory.szorc@gmail.com>
parents: 35393
diff changeset
   249
  content-type: application/x-bzip2
37008
16203c6079e7 tests: use $HTTP_DATE$ for Date header
Gregory Szorc <gregory.szorc@gmail.com>
parents: 36874
diff changeset
   250
  date: $HTTP_DATE$
36874
40193f977a8b tests: additional test coverage of archive web command
Gregory Szorc <gregory.szorc@gmail.com>
parents: 35393
diff changeset
   251
  etag: W/"*" (glob)
37009
5890e5872f36 hgweb: allow defining Server response header for HTTP server
Gregory Szorc <gregory.szorc@gmail.com>
parents: 37008
diff changeset
   252
  server: testing stub value
36874
40193f977a8b tests: additional test coverage of archive web command
Gregory Szorc <gregory.szorc@gmail.com>
parents: 35393
diff changeset
   253
  transfer-encoding: chunked
40193f977a8b tests: additional test coverage of archive web command
Gregory Szorc <gregory.szorc@gmail.com>
parents: 35393
diff changeset
   254
  
43071
830eacef67f8 tests: make tarball output conditional on Python version
Gregory Szorc <gregory.szorc@gmail.com>
parents: 42940
diff changeset
   255
  body: size=426, sha1=8d87f5aba6e14f1bfea6c232985982c278b2fb0b (no-py38 !)
44606
862025f108c7 tests: update test-archive.t expectations for python3.9 changes
Augie Fackler <augie@google.com>
parents: 43699
diff changeset
   256
  body: size=506, sha1=1bd1f8e8d3701704bd4385038bd9c09b81c77f4e (py38 no-py39 !)
862025f108c7 tests: update test-archive.t expectations for python3.9 changes
Augie Fackler <augie@google.com>
parents: 43699
diff changeset
   257
  body: size=503, sha1=2d8ce8bb3816603b9683a1804a5a02c11224cb01 (py39 !)
34654
4182d2065e7a configitems: drop redundant default of web.allow<archtype>
Yuya Nishihara <yuya@tcha.org>
parents: 33944
diff changeset
   258
  % zip and tar.gz disallowed should both give 403
4182d2065e7a configitems: drop redundant default of web.allow<archtype>
Yuya Nishihara <yuya@tcha.org>
parents: 33944
diff changeset
   259
  403 Archive type not allowed: zip
36874
40193f977a8b tests: additional test coverage of archive web command
Gregory Szorc <gregory.szorc@gmail.com>
parents: 35393
diff changeset
   260
  content-type: text/html; charset=ascii
37008
16203c6079e7 tests: use $HTTP_DATE$ for Date header
Gregory Szorc <gregory.szorc@gmail.com>
parents: 36874
diff changeset
   261
  date: $HTTP_DATE$
36874
40193f977a8b tests: additional test coverage of archive web command
Gregory Szorc <gregory.szorc@gmail.com>
parents: 35393
diff changeset
   262
  etag: W/"*" (glob)
37009
5890e5872f36 hgweb: allow defining Server response header for HTTP server
Gregory Szorc <gregory.szorc@gmail.com>
parents: 37008
diff changeset
   263
  server: testing stub value
36874
40193f977a8b tests: additional test coverage of archive web command
Gregory Szorc <gregory.szorc@gmail.com>
parents: 35393
diff changeset
   264
  transfer-encoding: chunked
40193f977a8b tests: additional test coverage of archive web command
Gregory Szorc <gregory.szorc@gmail.com>
parents: 35393
diff changeset
   265
  
40193f977a8b tests: additional test coverage of archive web command
Gregory Szorc <gregory.szorc@gmail.com>
parents: 35393
diff changeset
   266
  body: size=1451, sha1=cbfa5574b337348bfd0564cc534474d002e7d6c7
34654
4182d2065e7a configitems: drop redundant default of web.allow<archtype>
Yuya Nishihara <yuya@tcha.org>
parents: 33944
diff changeset
   267
  403 Archive type not allowed: gz
36874
40193f977a8b tests: additional test coverage of archive web command
Gregory Szorc <gregory.szorc@gmail.com>
parents: 35393
diff changeset
   268
  content-type: text/html; charset=ascii
37008
16203c6079e7 tests: use $HTTP_DATE$ for Date header
Gregory Szorc <gregory.szorc@gmail.com>
parents: 36874
diff changeset
   269
  date: $HTTP_DATE$
36874
40193f977a8b tests: additional test coverage of archive web command
Gregory Szorc <gregory.szorc@gmail.com>
parents: 35393
diff changeset
   270
  etag: W/"*" (glob)
37009
5890e5872f36 hgweb: allow defining Server response header for HTTP server
Gregory Szorc <gregory.szorc@gmail.com>
parents: 37008
diff changeset
   271
  server: testing stub value
36874
40193f977a8b tests: additional test coverage of archive web command
Gregory Szorc <gregory.szorc@gmail.com>
parents: 35393
diff changeset
   272
  transfer-encoding: chunked
40193f977a8b tests: additional test coverage of archive web command
Gregory Szorc <gregory.szorc@gmail.com>
parents: 35393
diff changeset
   273
  
40193f977a8b tests: additional test coverage of archive web command
Gregory Szorc <gregory.szorc@gmail.com>
parents: 35393
diff changeset
   274
  body: size=1450, sha1=71f0b12d59f85fdcfe8ff493e2dc66863f2f7734
34654
4182d2065e7a configitems: drop redundant default of web.allow<archtype>
Yuya Nishihara <yuya@tcha.org>
parents: 33944
diff changeset
   275
  $ test_archtype_deprecated zip zip tar.gz tar.bz2
4182d2065e7a configitems: drop redundant default of web.allow<archtype>
Yuya Nishihara <yuya@tcha.org>
parents: 33944
diff changeset
   276
  % zip allowed should give 200
4182d2065e7a configitems: drop redundant default of web.allow<archtype>
Yuya Nishihara <yuya@tcha.org>
parents: 33944
diff changeset
   277
  200 Script output follows
36874
40193f977a8b tests: additional test coverage of archive web command
Gregory Szorc <gregory.szorc@gmail.com>
parents: 35393
diff changeset
   278
  content-disposition: attachment; filename=test-archive-1701ef1f1510.zip
40193f977a8b tests: additional test coverage of archive web command
Gregory Szorc <gregory.szorc@gmail.com>
parents: 35393
diff changeset
   279
  content-type: application/zip
37008
16203c6079e7 tests: use $HTTP_DATE$ for Date header
Gregory Szorc <gregory.szorc@gmail.com>
parents: 36874
diff changeset
   280
  date: $HTTP_DATE$
36874
40193f977a8b tests: additional test coverage of archive web command
Gregory Szorc <gregory.szorc@gmail.com>
parents: 35393
diff changeset
   281
  etag: W/"*" (glob)
37009
5890e5872f36 hgweb: allow defining Server response header for HTTP server
Gregory Szorc <gregory.szorc@gmail.com>
parents: 37008
diff changeset
   282
  server: testing stub value
36874
40193f977a8b tests: additional test coverage of archive web command
Gregory Szorc <gregory.szorc@gmail.com>
parents: 35393
diff changeset
   283
  transfer-encoding: chunked
40193f977a8b tests: additional test coverage of archive web command
Gregory Szorc <gregory.szorc@gmail.com>
parents: 35393
diff changeset
   284
  
41316
8df3471931cc tests: add size and hash for Python 3
Gregory Szorc <gregory.szorc@gmail.com>
parents: 40305
diff changeset
   285
  body: size=(1377|1461|1489), sha1=(677b14d3d048778d5eb5552c14a67e6192068650|be6d3983aa13dfe930361b2569291cdedd02b537|1897e496871aa89ad685a92b936f5fa0d008b9e8) (re)
34654
4182d2065e7a configitems: drop redundant default of web.allow<archtype>
Yuya Nishihara <yuya@tcha.org>
parents: 33944
diff changeset
   286
  % tar.gz and tar.bz2 disallowed should both give 403
4182d2065e7a configitems: drop redundant default of web.allow<archtype>
Yuya Nishihara <yuya@tcha.org>
parents: 33944
diff changeset
   287
  403 Archive type not allowed: gz
36874
40193f977a8b tests: additional test coverage of archive web command
Gregory Szorc <gregory.szorc@gmail.com>
parents: 35393
diff changeset
   288
  content-type: text/html; charset=ascii
37008
16203c6079e7 tests: use $HTTP_DATE$ for Date header
Gregory Szorc <gregory.szorc@gmail.com>
parents: 36874
diff changeset
   289
  date: $HTTP_DATE$
36874
40193f977a8b tests: additional test coverage of archive web command
Gregory Szorc <gregory.szorc@gmail.com>
parents: 35393
diff changeset
   290
  etag: W/"*" (glob)
37009
5890e5872f36 hgweb: allow defining Server response header for HTTP server
Gregory Szorc <gregory.szorc@gmail.com>
parents: 37008
diff changeset
   291
  server: testing stub value
36874
40193f977a8b tests: additional test coverage of archive web command
Gregory Szorc <gregory.szorc@gmail.com>
parents: 35393
diff changeset
   292
  transfer-encoding: chunked
40193f977a8b tests: additional test coverage of archive web command
Gregory Szorc <gregory.szorc@gmail.com>
parents: 35393
diff changeset
   293
  
40193f977a8b tests: additional test coverage of archive web command
Gregory Szorc <gregory.szorc@gmail.com>
parents: 35393
diff changeset
   294
  body: size=1450, sha1=71f0b12d59f85fdcfe8ff493e2dc66863f2f7734
34654
4182d2065e7a configitems: drop redundant default of web.allow<archtype>
Yuya Nishihara <yuya@tcha.org>
parents: 33944
diff changeset
   295
  403 Archive type not allowed: bz2
36874
40193f977a8b tests: additional test coverage of archive web command
Gregory Szorc <gregory.szorc@gmail.com>
parents: 35393
diff changeset
   296
  content-type: text/html; charset=ascii
37008
16203c6079e7 tests: use $HTTP_DATE$ for Date header
Gregory Szorc <gregory.szorc@gmail.com>
parents: 36874
diff changeset
   297
  date: $HTTP_DATE$
36874
40193f977a8b tests: additional test coverage of archive web command
Gregory Szorc <gregory.szorc@gmail.com>
parents: 35393
diff changeset
   298
  etag: W/"*" (glob)
37009
5890e5872f36 hgweb: allow defining Server response header for HTTP server
Gregory Szorc <gregory.szorc@gmail.com>
parents: 37008
diff changeset
   299
  server: testing stub value
36874
40193f977a8b tests: additional test coverage of archive web command
Gregory Szorc <gregory.szorc@gmail.com>
parents: 35393
diff changeset
   300
  transfer-encoding: chunked
40193f977a8b tests: additional test coverage of archive web command
Gregory Szorc <gregory.szorc@gmail.com>
parents: 35393
diff changeset
   301
  
40193f977a8b tests: additional test coverage of archive web command
Gregory Szorc <gregory.szorc@gmail.com>
parents: 35393
diff changeset
   302
  body: size=1451, sha1=4c5cf0f574446c44feb7f88f4e0e2a56bd92c352
34654
4182d2065e7a configitems: drop redundant default of web.allow<archtype>
Yuya Nishihara <yuya@tcha.org>
parents: 33944
diff changeset
   303
38215
f715faeaceee config: rename allow_archive to allow-archive
David Demelier <markand@malikania.fr>
parents: 37009
diff changeset
   304
  $ echo "allow-archive = gz bz2 zip" >> .hg/hgrc
11853
afe19a1bf9d3 tests: unify test-archive
Martin Geisler <mg@lazybytes.net>
parents: 10650
diff changeset
   305
  $ hg serve -p $HGPORT -d --pid-file=hg.pid -E errors.log
afe19a1bf9d3 tests: unify test-archive
Martin Geisler <mg@lazybytes.net>
parents: 10650
diff changeset
   306
  $ cat hg.pid >> $DAEMON_PIDS
7029
b84d27386285 hgweb: Respond with HTTP 403 for disabled archive types instead of 404
Rocco Rutte <pdmef@gmx.net>
parents: 6496
diff changeset
   307
30747
4259df518223 hgweb: test the order of archive links
Anton Shestakov <av6@dwimlabs.net>
parents: 29562
diff changeset
   308
check archive links' order
4259df518223 hgweb: test the order of archive links
Anton Shestakov <av6@dwimlabs.net>
parents: 29562
diff changeset
   309
4259df518223 hgweb: test the order of archive links
Anton Shestakov <av6@dwimlabs.net>
parents: 29562
diff changeset
   310
  $ get-with-headers.py localhost:$HGPORT "?revcount=1" | grep '/archive/tip.'
4259df518223 hgweb: test the order of archive links
Anton Shestakov <av6@dwimlabs.net>
parents: 29562
diff changeset
   311
  <a href="/archive/tip.zip">zip</a>
4259df518223 hgweb: test the order of archive links
Anton Shestakov <av6@dwimlabs.net>
parents: 29562
diff changeset
   312
  <a href="/archive/tip.tar.gz">gz</a>
4259df518223 hgweb: test the order of archive links
Anton Shestakov <av6@dwimlabs.net>
parents: 29562
diff changeset
   313
  <a href="/archive/tip.tar.bz2">bz2</a>
4259df518223 hgweb: test the order of archive links
Anton Shestakov <av6@dwimlabs.net>
parents: 29562
diff changeset
   314
11853
afe19a1bf9d3 tests: unify test-archive
Martin Geisler <mg@lazybytes.net>
parents: 10650
diff changeset
   315
invalid arch type should give 404
1166
bd66294b7a9b Added test case for zip/gz/bz2 archive downloads.
Thomas Arendsen Hein <thomas@intevation.de>
parents:
diff changeset
   316
25472
4d2b9b304ad0 tests: drop explicit $TESTDIR from executables
Matt Mackall <mpm@selenic.com>
parents: 25125
diff changeset
   317
  $ get-with-headers.py localhost:$HGPORT "archive/tip.invalid" | head -n 1
11853
afe19a1bf9d3 tests: unify test-archive
Martin Geisler <mg@lazybytes.net>
parents: 10650
diff changeset
   318
  404 Unsupported archive type: None
7029
b84d27386285 hgweb: Respond with HTTP 403 for disabled archive types instead of 404
Rocco Rutte <pdmef@gmx.net>
parents: 6496
diff changeset
   319
11853
afe19a1bf9d3 tests: unify test-archive
Martin Geisler <mg@lazybytes.net>
parents: 10650
diff changeset
   320
  $ TIP=`hg id -v | cut -f1 -d' '`
afe19a1bf9d3 tests: unify test-archive
Martin Geisler <mg@lazybytes.net>
parents: 10650
diff changeset
   321
  $ QTIP=`hg id -q`
afe19a1bf9d3 tests: unify test-archive
Martin Geisler <mg@lazybytes.net>
parents: 10650
diff changeset
   322
  $ cat > getarchive.py <<EOF
29179
ce1c6ab15807 tests: test-archive.t use absolute_import
timeless <timeless@mozdev.org>
parents: 29178
diff changeset
   323
  > from __future__ import absolute_import
ce1c6ab15807 tests: test-archive.t use absolute_import
timeless <timeless@mozdev.org>
parents: 29178
diff changeset
   324
  > import os
ce1c6ab15807 tests: test-archive.t use absolute_import
timeless <timeless@mozdev.org>
parents: 29178
diff changeset
   325
  > import sys
29183
6def44ab4769 tests: test-archive.t use mercurial.util for urllib compat
timeless <timeless@mozdev.org>
parents: 29182
diff changeset
   326
  > from mercurial import (
6def44ab4769 tests: test-archive.t use mercurial.util for urllib compat
timeless <timeless@mozdev.org>
parents: 29182
diff changeset
   327
  >     util,
6def44ab4769 tests: test-archive.t use mercurial.util for urllib compat
timeless <timeless@mozdev.org>
parents: 29182
diff changeset
   328
  > )
11853
afe19a1bf9d3 tests: unify test-archive
Martin Geisler <mg@lazybytes.net>
parents: 10650
diff changeset
   329
  > try:
afe19a1bf9d3 tests: unify test-archive
Martin Geisler <mg@lazybytes.net>
parents: 10650
diff changeset
   330
  >     # Set stdout to binary mode for win32 platforms
afe19a1bf9d3 tests: unify test-archive
Martin Geisler <mg@lazybytes.net>
parents: 10650
diff changeset
   331
  >     import msvcrt
afe19a1bf9d3 tests: unify test-archive
Martin Geisler <mg@lazybytes.net>
parents: 10650
diff changeset
   332
  >     msvcrt.setmode(sys.stdout.fileno(), os.O_BINARY)
afe19a1bf9d3 tests: unify test-archive
Martin Geisler <mg@lazybytes.net>
parents: 10650
diff changeset
   333
  > except ImportError:
afe19a1bf9d3 tests: unify test-archive
Martin Geisler <mg@lazybytes.net>
parents: 10650
diff changeset
   334
  >     pass
18770
dcb6a99e82ff test-archive: gracefully handle HTTPErrors on get-with-headers
Angel Ezquerra <angel.ezquerra@gmail.com>
parents: 17743
diff changeset
   335
  > if len(sys.argv) <= 3:
dcb6a99e82ff test-archive: gracefully handle HTTPErrors on get-with-headers
Angel Ezquerra <angel.ezquerra@gmail.com>
parents: 17743
diff changeset
   336
  >     node, archive = sys.argv[1:]
dcb6a99e82ff test-archive: gracefully handle HTTPErrors on get-with-headers
Angel Ezquerra <angel.ezquerra@gmail.com>
parents: 17743
diff changeset
   337
  >     requeststr = 'cmd=archive;node=%s;type=%s' % (node, archive)
dcb6a99e82ff test-archive: gracefully handle HTTPErrors on get-with-headers
Angel Ezquerra <angel.ezquerra@gmail.com>
parents: 17743
diff changeset
   338
  > else:
dcb6a99e82ff test-archive: gracefully handle HTTPErrors on get-with-headers
Angel Ezquerra <angel.ezquerra@gmail.com>
parents: 17743
diff changeset
   339
  >     node, archive, file = sys.argv[1:]
dcb6a99e82ff test-archive: gracefully handle HTTPErrors on get-with-headers
Angel Ezquerra <angel.ezquerra@gmail.com>
parents: 17743
diff changeset
   340
  >     requeststr = 'cmd=archive;node=%s;type=%s;file=%s' % (node, archive, file)
dcb6a99e82ff test-archive: gracefully handle HTTPErrors on get-with-headers
Angel Ezquerra <angel.ezquerra@gmail.com>
parents: 17743
diff changeset
   341
  > try:
29182
6c0b1d964537 tests: test-archive.t use sys.stdout.buffer for binary output in py3
timeless <timeless@mozdev.org>
parents: 29179
diff changeset
   342
  >     stdout = sys.stdout.buffer
6c0b1d964537 tests: test-archive.t use sys.stdout.buffer for binary output in py3
timeless <timeless@mozdev.org>
parents: 29179
diff changeset
   343
  > except AttributeError:
6c0b1d964537 tests: test-archive.t use sys.stdout.buffer for binary output in py3
timeless <timeless@mozdev.org>
parents: 29179
diff changeset
   344
  >     stdout = sys.stdout
6c0b1d964537 tests: test-archive.t use sys.stdout.buffer for binary output in py3
timeless <timeless@mozdev.org>
parents: 29179
diff changeset
   345
  > try:
31008
636cf3f7620d tests: use LOCALIP
Jun Wu <quark@fb.com>
parents: 30844
diff changeset
   346
  >     f = util.urlreq.urlopen('http://$LOCALIP:%s/?%s'
18770
dcb6a99e82ff test-archive: gracefully handle HTTPErrors on get-with-headers
Angel Ezquerra <angel.ezquerra@gmail.com>
parents: 17743
diff changeset
   347
  >                     % (os.environ['HGPORT'], requeststr))
29182
6c0b1d964537 tests: test-archive.t use sys.stdout.buffer for binary output in py3
timeless <timeless@mozdev.org>
parents: 29179
diff changeset
   348
  >     stdout.write(f.read())
29183
6def44ab4769 tests: test-archive.t use mercurial.util for urllib compat
timeless <timeless@mozdev.org>
parents: 29182
diff changeset
   349
  > except util.urlerr.httperror as e:
18770
dcb6a99e82ff test-archive: gracefully handle HTTPErrors on get-with-headers
Angel Ezquerra <angel.ezquerra@gmail.com>
parents: 17743
diff changeset
   350
  >     sys.stderr.write(str(e) + '\n')
11853
afe19a1bf9d3 tests: unify test-archive
Martin Geisler <mg@lazybytes.net>
parents: 10650
diff changeset
   351
  > EOF
39707
5abc47d4ca6b tests: quote PYTHON usage
Matt Harbison <matt_harbison@yahoo.com>
parents: 38215
diff changeset
   352
  $ "$PYTHON" getarchive.py "$TIP" gz | gunzip | tar tf - 2>/dev/null
23231
32dadb2637f4 tests: introduce a subrepository to test-archive.t
Matt Harbison <matt_harbison@yahoo.com>
parents: 22046
diff changeset
   353
  test-archive-1701ef1f1510/.hg_archival.txt
32dadb2637f4 tests: introduce a subrepository to test-archive.t
Matt Harbison <matt_harbison@yahoo.com>
parents: 22046
diff changeset
   354
  test-archive-1701ef1f1510/.hgsub
32dadb2637f4 tests: introduce a subrepository to test-archive.t
Matt Harbison <matt_harbison@yahoo.com>
parents: 22046
diff changeset
   355
  test-archive-1701ef1f1510/.hgsubstate
32dadb2637f4 tests: introduce a subrepository to test-archive.t
Matt Harbison <matt_harbison@yahoo.com>
parents: 22046
diff changeset
   356
  test-archive-1701ef1f1510/bar
32dadb2637f4 tests: introduce a subrepository to test-archive.t
Matt Harbison <matt_harbison@yahoo.com>
parents: 22046
diff changeset
   357
  test-archive-1701ef1f1510/baz/bletch
32dadb2637f4 tests: introduce a subrepository to test-archive.t
Matt Harbison <matt_harbison@yahoo.com>
parents: 22046
diff changeset
   358
  test-archive-1701ef1f1510/foo
23232
a0ccb66f344d hgweb: fix a crash when using web.archivesubrepos
Matt Harbison <matt_harbison@yahoo.com>
parents: 23231
diff changeset
   359
  test-archive-1701ef1f1510/subrepo/sub
39707
5abc47d4ca6b tests: quote PYTHON usage
Matt Harbison <matt_harbison@yahoo.com>
parents: 38215
diff changeset
   360
  $ "$PYTHON" getarchive.py "$TIP" bz2 | bunzip2 | tar tf - 2>/dev/null
23231
32dadb2637f4 tests: introduce a subrepository to test-archive.t
Matt Harbison <matt_harbison@yahoo.com>
parents: 22046
diff changeset
   361
  test-archive-1701ef1f1510/.hg_archival.txt
32dadb2637f4 tests: introduce a subrepository to test-archive.t
Matt Harbison <matt_harbison@yahoo.com>
parents: 22046
diff changeset
   362
  test-archive-1701ef1f1510/.hgsub
32dadb2637f4 tests: introduce a subrepository to test-archive.t
Matt Harbison <matt_harbison@yahoo.com>
parents: 22046
diff changeset
   363
  test-archive-1701ef1f1510/.hgsubstate
32dadb2637f4 tests: introduce a subrepository to test-archive.t
Matt Harbison <matt_harbison@yahoo.com>
parents: 22046
diff changeset
   364
  test-archive-1701ef1f1510/bar
32dadb2637f4 tests: introduce a subrepository to test-archive.t
Matt Harbison <matt_harbison@yahoo.com>
parents: 22046
diff changeset
   365
  test-archive-1701ef1f1510/baz/bletch
32dadb2637f4 tests: introduce a subrepository to test-archive.t
Matt Harbison <matt_harbison@yahoo.com>
parents: 22046
diff changeset
   366
  test-archive-1701ef1f1510/foo
23232
a0ccb66f344d hgweb: fix a crash when using web.archivesubrepos
Matt Harbison <matt_harbison@yahoo.com>
parents: 23231
diff changeset
   367
  test-archive-1701ef1f1510/subrepo/sub
39707
5abc47d4ca6b tests: quote PYTHON usage
Matt Harbison <matt_harbison@yahoo.com>
parents: 38215
diff changeset
   368
  $ "$PYTHON" getarchive.py "$TIP" zip > archive.zip
12366
c01dc9087d9a tests: drop a bunch of sed calls from unified tests
Matt Mackall <mpm@selenic.com>
parents: 12339
diff changeset
   369
  $ unzip -t archive.zip
11853
afe19a1bf9d3 tests: unify test-archive
Martin Geisler <mg@lazybytes.net>
parents: 10650
diff changeset
   370
  Archive:  archive.zip
29562
cda10ff3175a tests: glob whitespace between path and OK in unzip(1) output
Augie Fackler <augie@google.com>
parents: 29183
diff changeset
   371
      testing: test-archive-1701ef1f1510/.hg_archival.txt*OK (glob)
cda10ff3175a tests: glob whitespace between path and OK in unzip(1) output
Augie Fackler <augie@google.com>
parents: 29183
diff changeset
   372
      testing: test-archive-1701ef1f1510/.hgsub*OK (glob)
cda10ff3175a tests: glob whitespace between path and OK in unzip(1) output
Augie Fackler <augie@google.com>
parents: 29183
diff changeset
   373
      testing: test-archive-1701ef1f1510/.hgsubstate*OK (glob)
cda10ff3175a tests: glob whitespace between path and OK in unzip(1) output
Augie Fackler <augie@google.com>
parents: 29183
diff changeset
   374
      testing: test-archive-1701ef1f1510/bar*OK (glob)
cda10ff3175a tests: glob whitespace between path and OK in unzip(1) output
Augie Fackler <augie@google.com>
parents: 29183
diff changeset
   375
      testing: test-archive-1701ef1f1510/baz/bletch*OK (glob)
cda10ff3175a tests: glob whitespace between path and OK in unzip(1) output
Augie Fackler <augie@google.com>
parents: 29183
diff changeset
   376
      testing: test-archive-1701ef1f1510/foo*OK (glob)
cda10ff3175a tests: glob whitespace between path and OK in unzip(1) output
Augie Fackler <augie@google.com>
parents: 29183
diff changeset
   377
      testing: test-archive-1701ef1f1510/subrepo/sub*OK (glob)
11853
afe19a1bf9d3 tests: unify test-archive
Martin Geisler <mg@lazybytes.net>
parents: 10650
diff changeset
   378
  No errors detected in compressed data of archive.zip.
1166
bd66294b7a9b Added test case for zip/gz/bz2 archive downloads.
Thomas Arendsen Hein <thomas@intevation.de>
parents:
diff changeset
   379
18771
bb38f4f78104 hgweb: teach archive how to download a specific directory or file
Angel Ezquerra <angel.ezquerra@gmail.com>
parents: 18770
diff changeset
   380
test that we can download single directories and files
bb38f4f78104 hgweb: teach archive how to download a specific directory or file
Angel Ezquerra <angel.ezquerra@gmail.com>
parents: 18770
diff changeset
   381
39707
5abc47d4ca6b tests: quote PYTHON usage
Matt Harbison <matt_harbison@yahoo.com>
parents: 38215
diff changeset
   382
  $ "$PYTHON" getarchive.py "$TIP" gz baz | gunzip | tar tf - 2>/dev/null
23231
32dadb2637f4 tests: introduce a subrepository to test-archive.t
Matt Harbison <matt_harbison@yahoo.com>
parents: 22046
diff changeset
   383
  test-archive-1701ef1f1510/baz/bletch
39707
5abc47d4ca6b tests: quote PYTHON usage
Matt Harbison <matt_harbison@yahoo.com>
parents: 38215
diff changeset
   384
  $ "$PYTHON" getarchive.py "$TIP" gz foo | gunzip | tar tf - 2>/dev/null
23231
32dadb2637f4 tests: introduce a subrepository to test-archive.t
Matt Harbison <matt_harbison@yahoo.com>
parents: 22046
diff changeset
   385
  test-archive-1701ef1f1510/foo
18771
bb38f4f78104 hgweb: teach archive how to download a specific directory or file
Angel Ezquerra <angel.ezquerra@gmail.com>
parents: 18770
diff changeset
   386
18968
7d2a7f8e9da4 hgweb: respond HTTP_NOT_FOUND when an archive request does not match any files
Angel Ezquerra <angel.ezquerra@gmail.com>
parents: 18967
diff changeset
   387
test that we detect file patterns that match no files
7d2a7f8e9da4 hgweb: respond HTTP_NOT_FOUND when an archive request does not match any files
Angel Ezquerra <angel.ezquerra@gmail.com>
parents: 18967
diff changeset
   388
39707
5abc47d4ca6b tests: quote PYTHON usage
Matt Harbison <matt_harbison@yahoo.com>
parents: 38215
diff changeset
   389
  $ "$PYTHON" getarchive.py "$TIP" gz foobar
18968
7d2a7f8e9da4 hgweb: respond HTTP_NOT_FOUND when an archive request does not match any files
Angel Ezquerra <angel.ezquerra@gmail.com>
parents: 18967
diff changeset
   390
  HTTP Error 404: file(s) not found: foobar
7d2a7f8e9da4 hgweb: respond HTTP_NOT_FOUND when an archive request does not match any files
Angel Ezquerra <angel.ezquerra@gmail.com>
parents: 18967
diff changeset
   391
18771
bb38f4f78104 hgweb: teach archive how to download a specific directory or file
Angel Ezquerra <angel.ezquerra@gmail.com>
parents: 18770
diff changeset
   392
test that we reject unsafe patterns
bb38f4f78104 hgweb: teach archive how to download a specific directory or file
Angel Ezquerra <angel.ezquerra@gmail.com>
parents: 18770
diff changeset
   393
39707
5abc47d4ca6b tests: quote PYTHON usage
Matt Harbison <matt_harbison@yahoo.com>
parents: 38215
diff changeset
   394
  $ "$PYTHON" getarchive.py "$TIP" gz relre:baz
18968
7d2a7f8e9da4 hgweb: respond HTTP_NOT_FOUND when an archive request does not match any files
Angel Ezquerra <angel.ezquerra@gmail.com>
parents: 18967
diff changeset
   395
  HTTP Error 404: file(s) not found: relre:baz
18771
bb38f4f78104 hgweb: teach archive how to download a specific directory or file
Angel Ezquerra <angel.ezquerra@gmail.com>
parents: 18770
diff changeset
   396
25474
8c14f87bd0ae tests: drop DAEMON_PIDS from killdaemons calls
Matt Mackall <mpm@selenic.com>
parents: 25472
diff changeset
   397
  $ killdaemons.py
7344
58fd3c718ca4 tests: add killdaemons helper script
Matt Mackall <mpm@selenic.com>
parents: 7080
diff changeset
   398
11853
afe19a1bf9d3 tests: unify test-archive
Martin Geisler <mg@lazybytes.net>
parents: 10650
diff changeset
   399
  $ hg archive -t tar test.tar
afe19a1bf9d3 tests: unify test-archive
Martin Geisler <mg@lazybytes.net>
parents: 10650
diff changeset
   400
  $ tar tf test.tar
afe19a1bf9d3 tests: unify test-archive
Martin Geisler <mg@lazybytes.net>
parents: 10650
diff changeset
   401
  test/.hg_archival.txt
23231
32dadb2637f4 tests: introduce a subrepository to test-archive.t
Matt Harbison <matt_harbison@yahoo.com>
parents: 22046
diff changeset
   402
  test/.hgsub
32dadb2637f4 tests: introduce a subrepository to test-archive.t
Matt Harbison <matt_harbison@yahoo.com>
parents: 22046
diff changeset
   403
  test/.hgsubstate
11853
afe19a1bf9d3 tests: unify test-archive
Martin Geisler <mg@lazybytes.net>
parents: 10650
diff changeset
   404
  test/bar
afe19a1bf9d3 tests: unify test-archive
Martin Geisler <mg@lazybytes.net>
parents: 10650
diff changeset
   405
  test/baz/bletch
afe19a1bf9d3 tests: unify test-archive
Martin Geisler <mg@lazybytes.net>
parents: 10650
diff changeset
   406
  test/foo
afe19a1bf9d3 tests: unify test-archive
Martin Geisler <mg@lazybytes.net>
parents: 10650
diff changeset
   407
25125
bd625cd4e5e7 progress: get the extremely verbose output out of default debug
Pierre-Yves David <pierre-yves.david@fb.com>
parents: 23645
diff changeset
   408
  $ hg archive --debug -t tbz2 -X baz test.tar.bz2 --config progress.debug=true
23231
32dadb2637f4 tests: introduce a subrepository to test-archive.t
Matt Harbison <matt_harbison@yahoo.com>
parents: 22046
diff changeset
   409
  archiving: 0/4 files (0.00%)
32dadb2637f4 tests: introduce a subrepository to test-archive.t
Matt Harbison <matt_harbison@yahoo.com>
parents: 22046
diff changeset
   410
  archiving: .hgsub 1/4 files (25.00%)
32dadb2637f4 tests: introduce a subrepository to test-archive.t
Matt Harbison <matt_harbison@yahoo.com>
parents: 22046
diff changeset
   411
  archiving: .hgsubstate 2/4 files (50.00%)
32dadb2637f4 tests: introduce a subrepository to test-archive.t
Matt Harbison <matt_harbison@yahoo.com>
parents: 22046
diff changeset
   412
  archiving: bar 3/4 files (75.00%)
32dadb2637f4 tests: introduce a subrepository to test-archive.t
Matt Harbison <matt_harbison@yahoo.com>
parents: 22046
diff changeset
   413
  archiving: foo 4/4 files (100.00%)
11853
afe19a1bf9d3 tests: unify test-archive
Martin Geisler <mg@lazybytes.net>
parents: 10650
diff changeset
   414
  $ bunzip2 -dc test.tar.bz2 | tar tf - 2>/dev/null
afe19a1bf9d3 tests: unify test-archive
Martin Geisler <mg@lazybytes.net>
parents: 10650
diff changeset
   415
  test/.hg_archival.txt
23231
32dadb2637f4 tests: introduce a subrepository to test-archive.t
Matt Harbison <matt_harbison@yahoo.com>
parents: 22046
diff changeset
   416
  test/.hgsub
32dadb2637f4 tests: introduce a subrepository to test-archive.t
Matt Harbison <matt_harbison@yahoo.com>
parents: 22046
diff changeset
   417
  test/.hgsubstate
11853
afe19a1bf9d3 tests: unify test-archive
Martin Geisler <mg@lazybytes.net>
parents: 10650
diff changeset
   418
  test/bar
afe19a1bf9d3 tests: unify test-archive
Martin Geisler <mg@lazybytes.net>
parents: 10650
diff changeset
   419
  test/foo
2114
98cc126f9f3f update tests after changing archival code.
Vadim Gelfer <vadim.gelfer@gmail.com>
parents: 1929
diff changeset
   420
11853
afe19a1bf9d3 tests: unify test-archive
Martin Geisler <mg@lazybytes.net>
parents: 10650
diff changeset
   421
  $ hg archive -t tgz -p %b-%h test-%h.tar.gz
12366
c01dc9087d9a tests: drop a bunch of sed calls from unified tests
Matt Mackall <mpm@selenic.com>
parents: 12339
diff changeset
   422
  $ gzip -dc test-$QTIP.tar.gz | tar tf - 2>/dev/null
23231
32dadb2637f4 tests: introduce a subrepository to test-archive.t
Matt Harbison <matt_harbison@yahoo.com>
parents: 22046
diff changeset
   423
  test-1701ef1f1510/.hg_archival.txt
32dadb2637f4 tests: introduce a subrepository to test-archive.t
Matt Harbison <matt_harbison@yahoo.com>
parents: 22046
diff changeset
   424
  test-1701ef1f1510/.hgsub
32dadb2637f4 tests: introduce a subrepository to test-archive.t
Matt Harbison <matt_harbison@yahoo.com>
parents: 22046
diff changeset
   425
  test-1701ef1f1510/.hgsubstate
32dadb2637f4 tests: introduce a subrepository to test-archive.t
Matt Harbison <matt_harbison@yahoo.com>
parents: 22046
diff changeset
   426
  test-1701ef1f1510/bar
32dadb2637f4 tests: introduce a subrepository to test-archive.t
Matt Harbison <matt_harbison@yahoo.com>
parents: 22046
diff changeset
   427
  test-1701ef1f1510/baz/bletch
32dadb2637f4 tests: introduce a subrepository to test-archive.t
Matt Harbison <matt_harbison@yahoo.com>
parents: 22046
diff changeset
   428
  test-1701ef1f1510/foo
2114
98cc126f9f3f update tests after changing archival code.
Vadim Gelfer <vadim.gelfer@gmail.com>
parents: 1929
diff changeset
   429
11853
afe19a1bf9d3 tests: unify test-archive
Martin Geisler <mg@lazybytes.net>
parents: 10650
diff changeset
   430
  $ hg archive autodetected_test.tar
afe19a1bf9d3 tests: unify test-archive
Martin Geisler <mg@lazybytes.net>
parents: 10650
diff changeset
   431
  $ tar tf autodetected_test.tar
afe19a1bf9d3 tests: unify test-archive
Martin Geisler <mg@lazybytes.net>
parents: 10650
diff changeset
   432
  autodetected_test/.hg_archival.txt
23231
32dadb2637f4 tests: introduce a subrepository to test-archive.t
Matt Harbison <matt_harbison@yahoo.com>
parents: 22046
diff changeset
   433
  autodetected_test/.hgsub
32dadb2637f4 tests: introduce a subrepository to test-archive.t
Matt Harbison <matt_harbison@yahoo.com>
parents: 22046
diff changeset
   434
  autodetected_test/.hgsubstate
11853
afe19a1bf9d3 tests: unify test-archive
Martin Geisler <mg@lazybytes.net>
parents: 10650
diff changeset
   435
  autodetected_test/bar
afe19a1bf9d3 tests: unify test-archive
Martin Geisler <mg@lazybytes.net>
parents: 10650
diff changeset
   436
  autodetected_test/baz/bletch
afe19a1bf9d3 tests: unify test-archive
Martin Geisler <mg@lazybytes.net>
parents: 10650
diff changeset
   437
  autodetected_test/foo
10650
9ea7238ad935 archive: autodetect archive type by extension (issue2058)
David Wolever <david@wolever.net>
parents: 10154
diff changeset
   438
11853
afe19a1bf9d3 tests: unify test-archive
Martin Geisler <mg@lazybytes.net>
parents: 10650
diff changeset
   439
The '-t' should override autodetection
afe19a1bf9d3 tests: unify test-archive
Martin Geisler <mg@lazybytes.net>
parents: 10650
diff changeset
   440
afe19a1bf9d3 tests: unify test-archive
Martin Geisler <mg@lazybytes.net>
parents: 10650
diff changeset
   441
  $ hg archive -t tar autodetect_override_test.zip
afe19a1bf9d3 tests: unify test-archive
Martin Geisler <mg@lazybytes.net>
parents: 10650
diff changeset
   442
  $ tar tf autodetect_override_test.zip
afe19a1bf9d3 tests: unify test-archive
Martin Geisler <mg@lazybytes.net>
parents: 10650
diff changeset
   443
  autodetect_override_test.zip/.hg_archival.txt
23231
32dadb2637f4 tests: introduce a subrepository to test-archive.t
Matt Harbison <matt_harbison@yahoo.com>
parents: 22046
diff changeset
   444
  autodetect_override_test.zip/.hgsub
32dadb2637f4 tests: introduce a subrepository to test-archive.t
Matt Harbison <matt_harbison@yahoo.com>
parents: 22046
diff changeset
   445
  autodetect_override_test.zip/.hgsubstate
11853
afe19a1bf9d3 tests: unify test-archive
Martin Geisler <mg@lazybytes.net>
parents: 10650
diff changeset
   446
  autodetect_override_test.zip/bar
afe19a1bf9d3 tests: unify test-archive
Martin Geisler <mg@lazybytes.net>
parents: 10650
diff changeset
   447
  autodetect_override_test.zip/baz/bletch
afe19a1bf9d3 tests: unify test-archive
Martin Geisler <mg@lazybytes.net>
parents: 10650
diff changeset
   448
  autodetect_override_test.zip/foo
10650
9ea7238ad935 archive: autodetect archive type by extension (issue2058)
David Wolever <david@wolever.net>
parents: 10154
diff changeset
   449
11853
afe19a1bf9d3 tests: unify test-archive
Martin Geisler <mg@lazybytes.net>
parents: 10650
diff changeset
   450
  $ for ext in tar tar.gz tgz tar.bz2 tbz2 zip; do
afe19a1bf9d3 tests: unify test-archive
Martin Geisler <mg@lazybytes.net>
parents: 10650
diff changeset
   451
  >     hg archive auto_test.$ext
afe19a1bf9d3 tests: unify test-archive
Martin Geisler <mg@lazybytes.net>
parents: 10650
diff changeset
   452
  >     if [ -d auto_test.$ext ]; then
afe19a1bf9d3 tests: unify test-archive
Martin Geisler <mg@lazybytes.net>
parents: 10650
diff changeset
   453
  >         echo "extension $ext was not autodetected."
afe19a1bf9d3 tests: unify test-archive
Martin Geisler <mg@lazybytes.net>
parents: 10650
diff changeset
   454
  >     fi
afe19a1bf9d3 tests: unify test-archive
Martin Geisler <mg@lazybytes.net>
parents: 10650
diff changeset
   455
  > done
10650
9ea7238ad935 archive: autodetect archive type by extension (issue2058)
David Wolever <david@wolever.net>
parents: 10154
diff changeset
   456
11853
afe19a1bf9d3 tests: unify test-archive
Martin Geisler <mg@lazybytes.net>
parents: 10650
diff changeset
   457
  $ cat > md5comp.py <<EOF
33874
3b1add641232 tests: update test-archive to always use hashlib
Augie Fackler <raf@durin42.com>
parents: 32940
diff changeset
   458
  > from __future__ import absolute_import, print_function
3b1add641232 tests: update test-archive to always use hashlib
Augie Fackler <raf@durin42.com>
parents: 32940
diff changeset
   459
  > import hashlib
11853
afe19a1bf9d3 tests: unify test-archive
Martin Geisler <mg@lazybytes.net>
parents: 10650
diff changeset
   460
  > import sys
afe19a1bf9d3 tests: unify test-archive
Martin Geisler <mg@lazybytes.net>
parents: 10650
diff changeset
   461
  > f1, f2 = sys.argv[1:3]
33874
3b1add641232 tests: update test-archive to always use hashlib
Augie Fackler <raf@durin42.com>
parents: 32940
diff changeset
   462
  > h1 = hashlib.md5(open(f1, 'rb').read()).hexdigest()
3b1add641232 tests: update test-archive to always use hashlib
Augie Fackler <raf@durin42.com>
parents: 32940
diff changeset
   463
  > h2 = hashlib.md5(open(f2, 'rb').read()).hexdigest()
29177
df6b5c6d252a tests: test-archive.t use print_function
timeless <timeless@mozdev.org>
parents: 28597
diff changeset
   464
  > print(h1 == h2 or "md5 differ: " + repr((h1, h2)))
11853
afe19a1bf9d3 tests: unify test-archive
Martin Geisler <mg@lazybytes.net>
parents: 10650
diff changeset
   465
  > EOF
afe19a1bf9d3 tests: unify test-archive
Martin Geisler <mg@lazybytes.net>
parents: 10650
diff changeset
   466
13140
217ae7d5c8ee test-archive: whitespace cleanup
Martin Geisler <mg@aragost.com>
parents: 12398
diff changeset
   467
archive name is stored in the archive, so create similar archives and
217ae7d5c8ee test-archive: whitespace cleanup
Martin Geisler <mg@aragost.com>
parents: 12398
diff changeset
   468
rename them afterwards.
11853
afe19a1bf9d3 tests: unify test-archive
Martin Geisler <mg@lazybytes.net>
parents: 10650
diff changeset
   469
afe19a1bf9d3 tests: unify test-archive
Martin Geisler <mg@lazybytes.net>
parents: 10650
diff changeset
   470
  $ hg archive -t tgz tip.tar.gz
afe19a1bf9d3 tests: unify test-archive
Martin Geisler <mg@lazybytes.net>
parents: 10650
diff changeset
   471
  $ mv tip.tar.gz tip1.tar.gz
afe19a1bf9d3 tests: unify test-archive
Martin Geisler <mg@lazybytes.net>
parents: 10650
diff changeset
   472
  $ sleep 1
afe19a1bf9d3 tests: unify test-archive
Martin Geisler <mg@lazybytes.net>
parents: 10650
diff changeset
   473
  $ hg archive -t tgz tip.tar.gz
afe19a1bf9d3 tests: unify test-archive
Martin Geisler <mg@lazybytes.net>
parents: 10650
diff changeset
   474
  $ mv tip.tar.gz tip2.tar.gz
39707
5abc47d4ca6b tests: quote PYTHON usage
Matt Harbison <matt_harbison@yahoo.com>
parents: 38215
diff changeset
   475
  $ "$PYTHON" md5comp.py tip1.tar.gz tip2.tar.gz
11853
afe19a1bf9d3 tests: unify test-archive
Martin Geisler <mg@lazybytes.net>
parents: 10650
diff changeset
   476
  True
4653
ca023b63ba1f archive: test md5 consistency
Brendan Cully <brendan@kublai.com>
parents: 2571
diff changeset
   477
11853
afe19a1bf9d3 tests: unify test-archive
Martin Geisler <mg@lazybytes.net>
parents: 10650
diff changeset
   478
  $ hg archive -t zip -p /illegal test.zip
afe19a1bf9d3 tests: unify test-archive
Martin Geisler <mg@lazybytes.net>
parents: 10650
diff changeset
   479
  abort: archive prefix contains illegal components
12316
4134686b83e1 tests: add exit codes to unified tests
Matt Mackall <mpm@selenic.com>
parents: 11853
diff changeset
   480
  [255]
11853
afe19a1bf9d3 tests: unify test-archive
Martin Geisler <mg@lazybytes.net>
parents: 10650
diff changeset
   481
  $ hg archive -t zip -p very/../bad test.zip
afe19a1bf9d3 tests: unify test-archive
Martin Geisler <mg@lazybytes.net>
parents: 10650
diff changeset
   482
afe19a1bf9d3 tests: unify test-archive
Martin Geisler <mg@lazybytes.net>
parents: 10650
diff changeset
   483
  $ hg archive --config ui.archivemeta=false -t zip -r 2 test.zip
afe19a1bf9d3 tests: unify test-archive
Martin Geisler <mg@lazybytes.net>
parents: 10650
diff changeset
   484
  $ unzip -t test.zip
afe19a1bf9d3 tests: unify test-archive
Martin Geisler <mg@lazybytes.net>
parents: 10650
diff changeset
   485
  Archive:  test.zip
29562
cda10ff3175a tests: glob whitespace between path and OK in unzip(1) output
Augie Fackler <augie@google.com>
parents: 29183
diff changeset
   486
      testing: test/bar*OK (glob)
cda10ff3175a tests: glob whitespace between path and OK in unzip(1) output
Augie Fackler <augie@google.com>
parents: 29183
diff changeset
   487
      testing: test/baz/bletch*OK (glob)
cda10ff3175a tests: glob whitespace between path and OK in unzip(1) output
Augie Fackler <augie@google.com>
parents: 29183
diff changeset
   488
      testing: test/foo*OK (glob)
11853
afe19a1bf9d3 tests: unify test-archive
Martin Geisler <mg@lazybytes.net>
parents: 10650
diff changeset
   489
  No errors detected in compressed data of test.zip.
4653
ca023b63ba1f archive: test md5 consistency
Brendan Cully <brendan@kublai.com>
parents: 2571
diff changeset
   490
12366
c01dc9087d9a tests: drop a bunch of sed calls from unified tests
Matt Mackall <mpm@selenic.com>
parents: 12339
diff changeset
   491
  $ hg archive -t tar - | tar tf - 2>/dev/null
23231
32dadb2637f4 tests: introduce a subrepository to test-archive.t
Matt Harbison <matt_harbison@yahoo.com>
parents: 22046
diff changeset
   492
  test-1701ef1f1510/.hg_archival.txt
32dadb2637f4 tests: introduce a subrepository to test-archive.t
Matt Harbison <matt_harbison@yahoo.com>
parents: 22046
diff changeset
   493
  test-1701ef1f1510/.hgsub
32dadb2637f4 tests: introduce a subrepository to test-archive.t
Matt Harbison <matt_harbison@yahoo.com>
parents: 22046
diff changeset
   494
  test-1701ef1f1510/.hgsubstate
32dadb2637f4 tests: introduce a subrepository to test-archive.t
Matt Harbison <matt_harbison@yahoo.com>
parents: 22046
diff changeset
   495
  test-1701ef1f1510/bar
32dadb2637f4 tests: introduce a subrepository to test-archive.t
Matt Harbison <matt_harbison@yahoo.com>
parents: 22046
diff changeset
   496
  test-1701ef1f1510/baz/bletch
32dadb2637f4 tests: introduce a subrepository to test-archive.t
Matt Harbison <matt_harbison@yahoo.com>
parents: 22046
diff changeset
   497
  test-1701ef1f1510/foo
2114
98cc126f9f3f update tests after changing archival code.
Vadim Gelfer <vadim.gelfer@gmail.com>
parents: 1929
diff changeset
   498
11853
afe19a1bf9d3 tests: unify test-archive
Martin Geisler <mg@lazybytes.net>
parents: 10650
diff changeset
   499
  $ hg archive -r 0 -t tar rev-%r.tar
19870
055d5b3f83b1 tests: fix void and invalid test in test-archive.t
Mads Kiilerich <madski@unity3d.com>
parents: 18968
diff changeset
   500
  $ [ -f rev-0.tar ]
2476
0f7e4a39d9af archive: make "hg archive -t XXX -" to write to stdout
Vadim Gelfer <vadim.gelfer@gmail.com>
parents: 2187
diff changeset
   501
11853
afe19a1bf9d3 tests: unify test-archive
Martin Geisler <mg@lazybytes.net>
parents: 10650
diff changeset
   502
test .hg_archival.txt
4863
6dc0094c0827 archive: abort on empty repository. Fixes #624.
Brendan Cully <brendan@kublai.com>
parents: 4805
diff changeset
   503
11853
afe19a1bf9d3 tests: unify test-archive
Martin Geisler <mg@lazybytes.net>
parents: 10650
diff changeset
   504
  $ hg archive ../test-tags
afe19a1bf9d3 tests: unify test-archive
Martin Geisler <mg@lazybytes.net>
parents: 10650
diff changeset
   505
  $ cat ../test-tags/.hg_archival.txt
afe19a1bf9d3 tests: unify test-archive
Martin Geisler <mg@lazybytes.net>
parents: 10650
diff changeset
   506
  repo: daa7f7c60e0a224faa4ff77ca41b2760562af264
23231
32dadb2637f4 tests: introduce a subrepository to test-archive.t
Matt Harbison <matt_harbison@yahoo.com>
parents: 22046
diff changeset
   507
  node: 1701ef1f151069b8747038e93b5186bb43a47504
11853
afe19a1bf9d3 tests: unify test-archive
Martin Geisler <mg@lazybytes.net>
parents: 10650
diff changeset
   508
  branch: default
afe19a1bf9d3 tests: unify test-archive
Martin Geisler <mg@lazybytes.net>
parents: 10650
diff changeset
   509
  latesttag: null
23231
32dadb2637f4 tests: introduce a subrepository to test-archive.t
Matt Harbison <matt_harbison@yahoo.com>
parents: 22046
diff changeset
   510
  latesttagdistance: 4
23645
242d11819c6c archive: store number of changes since latest tag as well
Siddharth Agarwal <sid0@fb.com>
parents: 23232
diff changeset
   511
  changessincelatesttag: 4
11853
afe19a1bf9d3 tests: unify test-archive
Martin Geisler <mg@lazybytes.net>
parents: 10650
diff changeset
   512
  $ hg tag -r 2 mytag
afe19a1bf9d3 tests: unify test-archive
Martin Geisler <mg@lazybytes.net>
parents: 10650
diff changeset
   513
  $ hg tag -r 2 anothertag
afe19a1bf9d3 tests: unify test-archive
Martin Geisler <mg@lazybytes.net>
parents: 10650
diff changeset
   514
  $ hg archive -r 2 ../test-lasttag
afe19a1bf9d3 tests: unify test-archive
Martin Geisler <mg@lazybytes.net>
parents: 10650
diff changeset
   515
  $ cat ../test-lasttag/.hg_archival.txt
afe19a1bf9d3 tests: unify test-archive
Martin Geisler <mg@lazybytes.net>
parents: 10650
diff changeset
   516
  repo: daa7f7c60e0a224faa4ff77ca41b2760562af264
afe19a1bf9d3 tests: unify test-archive
Martin Geisler <mg@lazybytes.net>
parents: 10650
diff changeset
   517
  node: 2c0277f05ed49d1c8328fb9ba92fba7a5ebcb33e
afe19a1bf9d3 tests: unify test-archive
Martin Geisler <mg@lazybytes.net>
parents: 10650
diff changeset
   518
  branch: default
afe19a1bf9d3 tests: unify test-archive
Martin Geisler <mg@lazybytes.net>
parents: 10650
diff changeset
   519
  tag: anothertag
afe19a1bf9d3 tests: unify test-archive
Martin Geisler <mg@lazybytes.net>
parents: 10650
diff changeset
   520
  tag: mytag
5061
a49f2a4d5ff7 archive: abort on empty repository. Fixes #624.
Brendan Cully <brendan@kublai.com>
parents: 4836
diff changeset
   521
11853
afe19a1bf9d3 tests: unify test-archive
Martin Geisler <mg@lazybytes.net>
parents: 10650
diff changeset
   522
  $ hg archive -t bogus test.bogus
afe19a1bf9d3 tests: unify test-archive
Martin Geisler <mg@lazybytes.net>
parents: 10650
diff changeset
   523
  abort: unknown archive type 'bogus'
12316
4134686b83e1 tests: add exit codes to unified tests
Matt Mackall <mpm@selenic.com>
parents: 11853
diff changeset
   524
  [255]
9614
58edd448da4f archive: add branch and tag informations to the .hg_archival.txt file
Gilles Moris <gilles.moris@free.fr>
parents: 8296
diff changeset
   525
13143
c2e55c21db27 archive: add support for progress extension
Martin Geisler <mg@aragost.com>
parents: 13140
diff changeset
   526
enable progress extension:
c2e55c21db27 archive: add support for progress extension
Martin Geisler <mg@aragost.com>
parents: 13140
diff changeset
   527
c2e55c21db27 archive: add support for progress extension
Martin Geisler <mg@aragost.com>
parents: 13140
diff changeset
   528
  $ cp $HGRCPATH $HGRCPATH.no-progress
c2e55c21db27 archive: add support for progress extension
Martin Geisler <mg@aragost.com>
parents: 13140
diff changeset
   529
  $ cat >> $HGRCPATH <<EOF
c2e55c21db27 archive: add support for progress extension
Martin Geisler <mg@aragost.com>
parents: 13140
diff changeset
   530
  > [progress]
c2e55c21db27 archive: add support for progress extension
Martin Geisler <mg@aragost.com>
parents: 13140
diff changeset
   531
  > assume-tty = 1
13149
735dd8e8a208 progress using tests: disable time estimates to avoid flakiness
Augie Fackler <durin42@gmail.com>
parents: 13143
diff changeset
   532
  > format = topic bar number
13143
c2e55c21db27 archive: add support for progress extension
Martin Geisler <mg@aragost.com>
parents: 13140
diff changeset
   533
  > delay = 0
c2e55c21db27 archive: add support for progress extension
Martin Geisler <mg@aragost.com>
parents: 13140
diff changeset
   534
  > refresh = 0
c2e55c21db27 archive: add support for progress extension
Martin Geisler <mg@aragost.com>
parents: 13140
diff changeset
   535
  > width = 60
c2e55c21db27 archive: add support for progress extension
Martin Geisler <mg@aragost.com>
parents: 13140
diff changeset
   536
  > EOF
c2e55c21db27 archive: add support for progress extension
Martin Geisler <mg@aragost.com>
parents: 13140
diff changeset
   537
17743
6047947afb6b tests: drop filtercr.py and use the very explicit '\r (no-eol) (esc)' markup
Mads Kiilerich <mads@kiilerich.com>
parents: 17629
diff changeset
   538
  $ hg archive ../with-progress
6047947afb6b tests: drop filtercr.py and use the very explicit '\r (no-eol) (esc)' markup
Mads Kiilerich <mads@kiilerich.com>
parents: 17629
diff changeset
   539
  \r (no-eol) (esc)
23231
32dadb2637f4 tests: introduce a subrepository to test-archive.t
Matt Harbison <matt_harbison@yahoo.com>
parents: 22046
diff changeset
   540
  archiving [                                           ] 0/6\r (no-eol) (esc)
32dadb2637f4 tests: introduce a subrepository to test-archive.t
Matt Harbison <matt_harbison@yahoo.com>
parents: 22046
diff changeset
   541
  archiving [======>                                    ] 1/6\r (no-eol) (esc)
32dadb2637f4 tests: introduce a subrepository to test-archive.t
Matt Harbison <matt_harbison@yahoo.com>
parents: 22046
diff changeset
   542
  archiving [=============>                             ] 2/6\r (no-eol) (esc)
32dadb2637f4 tests: introduce a subrepository to test-archive.t
Matt Harbison <matt_harbison@yahoo.com>
parents: 22046
diff changeset
   543
  archiving [====================>                      ] 3/6\r (no-eol) (esc)
32dadb2637f4 tests: introduce a subrepository to test-archive.t
Matt Harbison <matt_harbison@yahoo.com>
parents: 22046
diff changeset
   544
  archiving [===========================>               ] 4/6\r (no-eol) (esc)
32dadb2637f4 tests: introduce a subrepository to test-archive.t
Matt Harbison <matt_harbison@yahoo.com>
parents: 22046
diff changeset
   545
  archiving [==================================>        ] 5/6\r (no-eol) (esc)
32dadb2637f4 tests: introduce a subrepository to test-archive.t
Matt Harbison <matt_harbison@yahoo.com>
parents: 22046
diff changeset
   546
  archiving [==========================================>] 6/6\r (no-eol) (esc)
17743
6047947afb6b tests: drop filtercr.py and use the very explicit '\r (no-eol) (esc)' markup
Mads Kiilerich <mads@kiilerich.com>
parents: 17629
diff changeset
   547
                                                              \r (no-eol) (esc)
13143
c2e55c21db27 archive: add support for progress extension
Martin Geisler <mg@aragost.com>
parents: 13140
diff changeset
   548
c2e55c21db27 archive: add support for progress extension
Martin Geisler <mg@aragost.com>
parents: 13140
diff changeset
   549
cleanup after progress extension test:
c2e55c21db27 archive: add support for progress extension
Martin Geisler <mg@aragost.com>
parents: 13140
diff changeset
   550
c2e55c21db27 archive: add support for progress extension
Martin Geisler <mg@aragost.com>
parents: 13140
diff changeset
   551
  $ cp $HGRCPATH.no-progress $HGRCPATH
c2e55c21db27 archive: add support for progress extension
Martin Geisler <mg@aragost.com>
parents: 13140
diff changeset
   552
11853
afe19a1bf9d3 tests: unify test-archive
Martin Geisler <mg@lazybytes.net>
parents: 10650
diff changeset
   553
server errors
afe19a1bf9d3 tests: unify test-archive
Martin Geisler <mg@lazybytes.net>
parents: 10650
diff changeset
   554
afe19a1bf9d3 tests: unify test-archive
Martin Geisler <mg@lazybytes.net>
parents: 10650
diff changeset
   555
  $ cat errors.log
6019
b70a530bdb93 cleanly abort on unknown archive type (issue966)
Dirkjan Ochtman <dirkjan@ochtman.nl>
parents: 5384
diff changeset
   556
11853
afe19a1bf9d3 tests: unify test-archive
Martin Geisler <mg@lazybytes.net>
parents: 10650
diff changeset
   557
empty repo
5924
b8009718a211 better error reporting for hg serve errors in tests
Dirkjan Ochtman <dirkjan@ochtman.nl>
parents: 5384
diff changeset
   558
11853
afe19a1bf9d3 tests: unify test-archive
Martin Geisler <mg@lazybytes.net>
parents: 10650
diff changeset
   559
  $ hg init ../empty
afe19a1bf9d3 tests: unify test-archive
Martin Geisler <mg@lazybytes.net>
parents: 10650
diff changeset
   560
  $ cd ../empty
afe19a1bf9d3 tests: unify test-archive
Martin Geisler <mg@lazybytes.net>
parents: 10650
diff changeset
   561
  $ hg archive ../test-empty
afe19a1bf9d3 tests: unify test-archive
Martin Geisler <mg@lazybytes.net>
parents: 10650
diff changeset
   562
  abort: no working directory: please specify a revision
45827
8d72e29ad1e0 errors: introduce InputError and use it from commands and cmdutil
Martin von Zweigbergk <martinvonz@google.com>
parents: 45048
diff changeset
   563
  [10]
13140
217ae7d5c8ee test-archive: whitespace cleanup
Martin Geisler <mg@aragost.com>
parents: 12398
diff changeset
   564
12321
11db6fa2961e merge with stable
Martin Geisler <mg@aragost.com>
parents: 12319 12316
diff changeset
   565
old file -- date clamped to 1980
5924
b8009718a211 better error reporting for hg serve errors in tests
Dirkjan Ochtman <dirkjan@ochtman.nl>
parents: 5384
diff changeset
   566
12368
9581d5efb6a5 tests: fix touch -t with RHEL
Matt Mackall <mpm@selenic.com>
parents: 12367
diff changeset
   567
  $ touch -t 197501010000 old
12321
11db6fa2961e merge with stable
Martin Geisler <mg@aragost.com>
parents: 12319 12316
diff changeset
   568
  $ hg add old
11db6fa2961e merge with stable
Martin Geisler <mg@aragost.com>
parents: 12319 12316
diff changeset
   569
  $ hg commit -m old
11db6fa2961e merge with stable
Martin Geisler <mg@aragost.com>
parents: 12319 12316
diff changeset
   570
  $ hg archive ../old.zip
30844
b3d2e8cce78c tests: work around FreeBSD's unzip having slightly different output
Augie Fackler <augie@google.com>
parents: 30747
diff changeset
   571
  $ unzip -l ../old.zip | grep -v -- ----- | egrep -v files$
12321
11db6fa2961e merge with stable
Martin Geisler <mg@aragost.com>
parents: 12319 12316
diff changeset
   572
  Archive:  ../old.zip
12375
02990e22150b tests: require regexes in unified tests to be marked with " (re)"
Brodie Rao <brodie@bitheap.org>
parents: 12372
diff changeset
   573
  \s*Length.* (re)
23645
242d11819c6c archive: store number of changes since latest tag as well
Siddharth Agarwal <sid0@fb.com>
parents: 23232
diff changeset
   574
  *172*80*00:00*old/.hg_archival.txt (glob)
12376
97ffc68f71d3 tests: add glob matching for unified tests
Brodie Rao <brodie@bitheap.org>
parents: 12375
diff changeset
   575
  *0*80*00:00*old/old (glob)
16913
f2719b387380 tests: add missing trailing 'cd ..'
Mads Kiilerich <mads@kiilerich.com>
parents: 16350
diff changeset
   576
42940
c04e0836f039 archive: add XZ support if built with Python 3
David Demelier <markand@malikania.fr>
parents: 41316
diff changeset
   577
test xz support only available in Python 3.4
c04e0836f039 archive: add XZ support if built with Python 3
David Demelier <markand@malikania.fr>
parents: 41316
diff changeset
   578
45048
2c0043977b6d archival: abort if compression method is unavailable
Manuel Jacob <me@manueljacob.de>
parents: 44606
diff changeset
   579
#if lzma
42940
c04e0836f039 archive: add XZ support if built with Python 3
David Demelier <markand@malikania.fr>
parents: 41316
diff changeset
   580
  $ hg archive ../archive.txz
43699
21e05aabef8c hghave: add a check for the `xz` compression utility
Matt Harbison <matt_harbison@yahoo.com>
parents: 43107
diff changeset
   581
  $ which xz >/dev/null && xz -l ../archive.txz | head -n1 || true
21e05aabef8c hghave: add a check for the `xz` compression utility
Matt Harbison <matt_harbison@yahoo.com>
parents: 43107
diff changeset
   582
  Strms  Blocks   Compressed Uncompressed  Ratio  Check   Filename (xz !)
42940
c04e0836f039 archive: add XZ support if built with Python 3
David Demelier <markand@malikania.fr>
parents: 41316
diff changeset
   583
  $ rm -f ../archive.txz
45048
2c0043977b6d archival: abort if compression method is unavailable
Manuel Jacob <me@manueljacob.de>
parents: 44606
diff changeset
   584
#endif
2c0043977b6d archival: abort if compression method is unavailable
Manuel Jacob <me@manueljacob.de>
parents: 44606
diff changeset
   585
#if py3 no-lzma
2c0043977b6d archival: abort if compression method is unavailable
Manuel Jacob <me@manueljacob.de>
parents: 44606
diff changeset
   586
  $ hg archive ../archive.txz
2c0043977b6d archival: abort if compression method is unavailable
Manuel Jacob <me@manueljacob.de>
parents: 44606
diff changeset
   587
  abort: lzma module is not available
2c0043977b6d archival: abort if compression method is unavailable
Manuel Jacob <me@manueljacob.de>
parents: 44606
diff changeset
   588
  [255]
2c0043977b6d archival: abort if compression method is unavailable
Manuel Jacob <me@manueljacob.de>
parents: 44606
diff changeset
   589
#endif
2c0043977b6d archival: abort if compression method is unavailable
Manuel Jacob <me@manueljacob.de>
parents: 44606
diff changeset
   590
#if no-py3
42940
c04e0836f039 archive: add XZ support if built with Python 3
David Demelier <markand@malikania.fr>
parents: 41316
diff changeset
   591
  $ hg archive ../archive.txz
c04e0836f039 archive: add XZ support if built with Python 3
David Demelier <markand@malikania.fr>
parents: 41316
diff changeset
   592
  abort: xz compression is only available in Python 3
c04e0836f039 archive: add XZ support if built with Python 3
David Demelier <markand@malikania.fr>
parents: 41316
diff changeset
   593
  [255]
c04e0836f039 archive: add XZ support if built with Python 3
David Demelier <markand@malikania.fr>
parents: 41316
diff changeset
   594
#endif
c04e0836f039 archive: add XZ support if built with Python 3
David Demelier <markand@malikania.fr>
parents: 41316
diff changeset
   595
18967
88d1b59f6906 archive: raise error.Abort if the file pattern matches no files
Angel Ezquerra <angel.ezquerra@gmail.com>
parents: 18771
diff changeset
   596
show an error when a provided pattern matches no files
88d1b59f6906 archive: raise error.Abort if the file pattern matches no files
Angel Ezquerra <angel.ezquerra@gmail.com>
parents: 18771
diff changeset
   597
88d1b59f6906 archive: raise error.Abort if the file pattern matches no files
Angel Ezquerra <angel.ezquerra@gmail.com>
parents: 18771
diff changeset
   598
  $ hg archive -I file_that_does_not_exist.foo ../empty.zip
88d1b59f6906 archive: raise error.Abort if the file pattern matches no files
Angel Ezquerra <angel.ezquerra@gmail.com>
parents: 18771
diff changeset
   599
  abort: no files match the archive pattern
88d1b59f6906 archive: raise error.Abort if the file pattern matches no files
Angel Ezquerra <angel.ezquerra@gmail.com>
parents: 18771
diff changeset
   600
  [255]
88d1b59f6906 archive: raise error.Abort if the file pattern matches no files
Angel Ezquerra <angel.ezquerra@gmail.com>
parents: 18771
diff changeset
   601
88d1b59f6906 archive: raise error.Abort if the file pattern matches no files
Angel Ezquerra <angel.ezquerra@gmail.com>
parents: 18771
diff changeset
   602
  $ hg archive -X * ../empty.zip
88d1b59f6906 archive: raise error.Abort if the file pattern matches no files
Angel Ezquerra <angel.ezquerra@gmail.com>
parents: 18771
diff changeset
   603
  abort: no files match the archive pattern
88d1b59f6906 archive: raise error.Abort if the file pattern matches no files
Angel Ezquerra <angel.ezquerra@gmail.com>
parents: 18771
diff changeset
   604
  [255]
88d1b59f6906 archive: raise error.Abort if the file pattern matches no files
Angel Ezquerra <angel.ezquerra@gmail.com>
parents: 18771
diff changeset
   605
16913
f2719b387380 tests: add missing trailing 'cd ..'
Mads Kiilerich <mads@kiilerich.com>
parents: 16350
diff changeset
   606
  $ cd ..
17628
133d13e44544 archival: add "extended-timestamp" extra block for zip archives (issue3600)
FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
parents: 17017
diff changeset
   607
133d13e44544 archival: add "extended-timestamp" extra block for zip archives (issue3600)
FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
parents: 17017
diff changeset
   608
issue3600: check whether "hg archive" can create archive files which
133d13e44544 archival: add "extended-timestamp" extra block for zip archives (issue3600)
FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
parents: 17017
diff changeset
   609
are extracted with expected timestamp, even though TZ is not
133d13e44544 archival: add "extended-timestamp" extra block for zip archives (issue3600)
FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
parents: 17017
diff changeset
   610
configured as GMT.
133d13e44544 archival: add "extended-timestamp" extra block for zip archives (issue3600)
FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
parents: 17017
diff changeset
   611
133d13e44544 archival: add "extended-timestamp" extra block for zip archives (issue3600)
FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
parents: 17017
diff changeset
   612
  $ mkdir issue3600
133d13e44544 archival: add "extended-timestamp" extra block for zip archives (issue3600)
FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
parents: 17017
diff changeset
   613
  $ cd issue3600
133d13e44544 archival: add "extended-timestamp" extra block for zip archives (issue3600)
FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
parents: 17017
diff changeset
   614
133d13e44544 archival: add "extended-timestamp" extra block for zip archives (issue3600)
FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
parents: 17017
diff changeset
   615
  $ hg init repo
133d13e44544 archival: add "extended-timestamp" extra block for zip archives (issue3600)
FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
parents: 17017
diff changeset
   616
  $ echo a > repo/a
133d13e44544 archival: add "extended-timestamp" extra block for zip archives (issue3600)
FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
parents: 17017
diff changeset
   617
  $ hg -R repo add repo/a
133d13e44544 archival: add "extended-timestamp" extra block for zip archives (issue3600)
FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
parents: 17017
diff changeset
   618
  $ hg -R repo commit -m '#0' -d '456789012 21600'
133d13e44544 archival: add "extended-timestamp" extra block for zip archives (issue3600)
FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
parents: 17017
diff changeset
   619
  $ cat > show_mtime.py <<EOF
33944
74e53c21fd13 tests: update test-archive to pass our module import checker
Augie Fackler <raf@durin42.com>
parents: 33874
diff changeset
   620
  > from __future__ import absolute_import, print_function
74e53c21fd13 tests: update test-archive to pass our module import checker
Augie Fackler <raf@durin42.com>
parents: 33874
diff changeset
   621
  > import os
74e53c21fd13 tests: update test-archive to pass our module import checker
Augie Fackler <raf@durin42.com>
parents: 33874
diff changeset
   622
  > import sys
29177
df6b5c6d252a tests: test-archive.t use print_function
timeless <timeless@mozdev.org>
parents: 28597
diff changeset
   623
  > print(int(os.stat(sys.argv[1]).st_mtime))
17628
133d13e44544 archival: add "extended-timestamp" extra block for zip archives (issue3600)
FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
parents: 17017
diff changeset
   624
  > EOF
133d13e44544 archival: add "extended-timestamp" extra block for zip archives (issue3600)
FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
parents: 17017
diff changeset
   625
133d13e44544 archival: add "extended-timestamp" extra block for zip archives (issue3600)
FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
parents: 17017
diff changeset
   626
  $ hg -R repo archive --prefix tar-extracted archive.tar
133d13e44544 archival: add "extended-timestamp" extra block for zip archives (issue3600)
FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
parents: 17017
diff changeset
   627
  $ (TZ=UTC-3; export TZ; tar xf archive.tar)
39707
5abc47d4ca6b tests: quote PYTHON usage
Matt Harbison <matt_harbison@yahoo.com>
parents: 38215
diff changeset
   628
  $ "$PYTHON" show_mtime.py tar-extracted/a
17628
133d13e44544 archival: add "extended-timestamp" extra block for zip archives (issue3600)
FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
parents: 17017
diff changeset
   629
  456789012
133d13e44544 archival: add "extended-timestamp" extra block for zip archives (issue3600)
FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
parents: 17017
diff changeset
   630
133d13e44544 archival: add "extended-timestamp" extra block for zip archives (issue3600)
FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
parents: 17017
diff changeset
   631
  $ hg -R repo archive --prefix zip-extracted archive.zip
133d13e44544 archival: add "extended-timestamp" extra block for zip archives (issue3600)
FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
parents: 17017
diff changeset
   632
  $ (TZ=UTC-3; export TZ; unzip -q archive.zip)
39707
5abc47d4ca6b tests: quote PYTHON usage
Matt Harbison <matt_harbison@yahoo.com>
parents: 38215
diff changeset
   633
  $ "$PYTHON" show_mtime.py zip-extracted/a
17628
133d13e44544 archival: add "extended-timestamp" extra block for zip archives (issue3600)
FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
parents: 17017
diff changeset
   634
  456789012
133d13e44544 archival: add "extended-timestamp" extra block for zip archives (issue3600)
FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
parents: 17017
diff changeset
   635
133d13e44544 archival: add "extended-timestamp" extra block for zip archives (issue3600)
FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
parents: 17017
diff changeset
   636
  $ cd ..