annotate tests/test-remotefilelog-prefetch.t @ 51727:a65c2dddbf5d

linelog: correct the default value of `annotateresult.lines` This was flagged by pytype once it was tricked into using the standard `attr` package instead of the vendored copy.
author Matt Harbison <matt_harbison@yahoo.com>
date Tue, 23 Jul 2024 19:05:26 -0400
parents dcaa2df1f688
children 7346f93be7a4
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
40722
0800d9e6e216 tests: disable remotefilelog on Windows
Matt Harbison <matt_harbison@yahoo.com>
parents: 40572
diff changeset
1 #require no-windows
0800d9e6e216 tests: disable remotefilelog on Windows
Matt Harbison <matt_harbison@yahoo.com>
parents: 40572
diff changeset
2
40495
3a333a582d7b remotefilelog: import pruned-down remotefilelog extension from hg-experimental
Augie Fackler <augie@google.com>
parents:
diff changeset
3 $ . "$TESTDIR/remotefilelog-library.sh"
3a333a582d7b remotefilelog: import pruned-down remotefilelog extension from hg-experimental
Augie Fackler <augie@google.com>
parents:
diff changeset
4
40571
95a079ea1e19 tests: drop obsolete "hginit" alias in remotefilelog tests
Martin von Zweigbergk <martinvonz@google.com>
parents: 40502
diff changeset
5 $ hg init master
40495
3a333a582d7b remotefilelog: import pruned-down remotefilelog extension from hg-experimental
Augie Fackler <augie@google.com>
parents:
diff changeset
6 $ cd master
3a333a582d7b remotefilelog: import pruned-down remotefilelog extension from hg-experimental
Augie Fackler <augie@google.com>
parents:
diff changeset
7 $ cat >> .hg/hgrc <<EOF
3a333a582d7b remotefilelog: import pruned-down remotefilelog extension from hg-experimental
Augie Fackler <augie@google.com>
parents:
diff changeset
8 > [remotefilelog]
3a333a582d7b remotefilelog: import pruned-down remotefilelog extension from hg-experimental
Augie Fackler <augie@google.com>
parents:
diff changeset
9 > server=True
3a333a582d7b remotefilelog: import pruned-down remotefilelog extension from hg-experimental
Augie Fackler <augie@google.com>
parents:
diff changeset
10 > EOF
3a333a582d7b remotefilelog: import pruned-down remotefilelog extension from hg-experimental
Augie Fackler <augie@google.com>
parents:
diff changeset
11 $ echo x > x
3a333a582d7b remotefilelog: import pruned-down remotefilelog extension from hg-experimental
Augie Fackler <augie@google.com>
parents:
diff changeset
12 $ echo z > z
3a333a582d7b remotefilelog: import pruned-down remotefilelog extension from hg-experimental
Augie Fackler <augie@google.com>
parents:
diff changeset
13 $ hg commit -qAm x
3a333a582d7b remotefilelog: import pruned-down remotefilelog extension from hg-experimental
Augie Fackler <augie@google.com>
parents:
diff changeset
14 $ echo x2 > x
3a333a582d7b remotefilelog: import pruned-down remotefilelog extension from hg-experimental
Augie Fackler <augie@google.com>
parents:
diff changeset
15 $ echo y > y
3a333a582d7b remotefilelog: import pruned-down remotefilelog extension from hg-experimental
Augie Fackler <augie@google.com>
parents:
diff changeset
16 $ hg commit -qAm y
3a333a582d7b remotefilelog: import pruned-down remotefilelog extension from hg-experimental
Augie Fackler <augie@google.com>
parents:
diff changeset
17 $ hg bookmark foo
3a333a582d7b remotefilelog: import pruned-down remotefilelog extension from hg-experimental
Augie Fackler <augie@google.com>
parents:
diff changeset
18
3a333a582d7b remotefilelog: import pruned-down remotefilelog extension from hg-experimental
Augie Fackler <augie@google.com>
parents:
diff changeset
19 $ cd ..
3a333a582d7b remotefilelog: import pruned-down remotefilelog extension from hg-experimental
Augie Fackler <augie@google.com>
parents:
diff changeset
20
3a333a582d7b remotefilelog: import pruned-down remotefilelog extension from hg-experimental
Augie Fackler <augie@google.com>
parents:
diff changeset
21 # prefetch a revision
3a333a582d7b remotefilelog: import pruned-down remotefilelog extension from hg-experimental
Augie Fackler <augie@google.com>
parents:
diff changeset
22
3a333a582d7b remotefilelog: import pruned-down remotefilelog extension from hg-experimental
Augie Fackler <augie@google.com>
parents:
diff changeset
23 $ hgcloneshallow ssh://user@dummy/master shallow --noupdate
3a333a582d7b remotefilelog: import pruned-down remotefilelog extension from hg-experimental
Augie Fackler <augie@google.com>
parents:
diff changeset
24 streaming all changes
51181
dcaa2df1f688 changelog: never inline changelog
Pierre-Yves David <pierre-yves.david@octobus.net>
parents: 47127
diff changeset
25 3 files to transfer, 528 bytes of data (no-zstd !)
46874
84a93fa7ecfd revlog-compression: use zstd by default (if available)
Pierre-Yves David <pierre-yves.david@octobus.net>
parents: 46847
diff changeset
26 transferred 528 bytes in * seconds (* */sec) (glob) (no-zstd !)
51181
dcaa2df1f688 changelog: never inline changelog
Pierre-Yves David <pierre-yves.david@octobus.net>
parents: 47127
diff changeset
27 3 files to transfer, 532 bytes of data (zstd no-rust !)
dcaa2df1f688 changelog: never inline changelog
Pierre-Yves David <pierre-yves.david@octobus.net>
parents: 47127
diff changeset
28 transferred 532 bytes in * seconds (* */sec) (glob) (zstd no-rust !)
dcaa2df1f688 changelog: never inline changelog
Pierre-Yves David <pierre-yves.david@octobus.net>
parents: 47127
diff changeset
29 5 files to transfer, 658 bytes of data (zstd rust !)
dcaa2df1f688 changelog: never inline changelog
Pierre-Yves David <pierre-yves.david@octobus.net>
parents: 47127
diff changeset
30 transferred 658 bytes in * seconds (*/sec) (glob) (zstd rust !)
40495
3a333a582d7b remotefilelog: import pruned-down remotefilelog extension from hg-experimental
Augie Fackler <augie@google.com>
parents:
diff changeset
31 searching for changes
3a333a582d7b remotefilelog: import pruned-down remotefilelog extension from hg-experimental
Augie Fackler <augie@google.com>
parents:
diff changeset
32 no changes found
3a333a582d7b remotefilelog: import pruned-down remotefilelog extension from hg-experimental
Augie Fackler <augie@google.com>
parents:
diff changeset
33 $ cd shallow
3a333a582d7b remotefilelog: import pruned-down remotefilelog extension from hg-experimental
Augie Fackler <augie@google.com>
parents:
diff changeset
34
3a333a582d7b remotefilelog: import pruned-down remotefilelog extension from hg-experimental
Augie Fackler <augie@google.com>
parents:
diff changeset
35 $ hg prefetch -r 0
3a333a582d7b remotefilelog: import pruned-down remotefilelog extension from hg-experimental
Augie Fackler <augie@google.com>
parents:
diff changeset
36 2 files fetched over 1 fetches - (2 misses, 0.00% hit ratio) over *s (glob)
3a333a582d7b remotefilelog: import pruned-down remotefilelog extension from hg-experimental
Augie Fackler <augie@google.com>
parents:
diff changeset
37
3a333a582d7b remotefilelog: import pruned-down remotefilelog extension from hg-experimental
Augie Fackler <augie@google.com>
parents:
diff changeset
38 $ hg cat -r 0 x
3a333a582d7b remotefilelog: import pruned-down remotefilelog extension from hg-experimental
Augie Fackler <augie@google.com>
parents:
diff changeset
39 x
3a333a582d7b remotefilelog: import pruned-down remotefilelog extension from hg-experimental
Augie Fackler <augie@google.com>
parents:
diff changeset
40
3a333a582d7b remotefilelog: import pruned-down remotefilelog extension from hg-experimental
Augie Fackler <augie@google.com>
parents:
diff changeset
41 # prefetch with base
3a333a582d7b remotefilelog: import pruned-down remotefilelog extension from hg-experimental
Augie Fackler <augie@google.com>
parents:
diff changeset
42
3a333a582d7b remotefilelog: import pruned-down remotefilelog extension from hg-experimental
Augie Fackler <augie@google.com>
parents:
diff changeset
43 $ clearcache
3a333a582d7b remotefilelog: import pruned-down remotefilelog extension from hg-experimental
Augie Fackler <augie@google.com>
parents:
diff changeset
44 $ hg prefetch -r 0::1 -b 0
3a333a582d7b remotefilelog: import pruned-down remotefilelog extension from hg-experimental
Augie Fackler <augie@google.com>
parents:
diff changeset
45 2 files fetched over 1 fetches - (2 misses, 0.00% hit ratio) over *s (glob)
3a333a582d7b remotefilelog: import pruned-down remotefilelog extension from hg-experimental
Augie Fackler <augie@google.com>
parents:
diff changeset
46
3a333a582d7b remotefilelog: import pruned-down remotefilelog extension from hg-experimental
Augie Fackler <augie@google.com>
parents:
diff changeset
47 $ hg cat -r 1 x
3a333a582d7b remotefilelog: import pruned-down remotefilelog extension from hg-experimental
Augie Fackler <augie@google.com>
parents:
diff changeset
48 x2
3a333a582d7b remotefilelog: import pruned-down remotefilelog extension from hg-experimental
Augie Fackler <augie@google.com>
parents:
diff changeset
49 $ hg cat -r 1 y
3a333a582d7b remotefilelog: import pruned-down remotefilelog extension from hg-experimental
Augie Fackler <augie@google.com>
parents:
diff changeset
50 y
3a333a582d7b remotefilelog: import pruned-down remotefilelog extension from hg-experimental
Augie Fackler <augie@google.com>
parents:
diff changeset
51
3a333a582d7b remotefilelog: import pruned-down remotefilelog extension from hg-experimental
Augie Fackler <augie@google.com>
parents:
diff changeset
52 $ hg cat -r 0 x
3a333a582d7b remotefilelog: import pruned-down remotefilelog extension from hg-experimental
Augie Fackler <augie@google.com>
parents:
diff changeset
53 x
3a333a582d7b remotefilelog: import pruned-down remotefilelog extension from hg-experimental
Augie Fackler <augie@google.com>
parents:
diff changeset
54 1 files fetched over 1 fetches - (1 misses, 0.00% hit ratio) over *s (glob)
3a333a582d7b remotefilelog: import pruned-down remotefilelog extension from hg-experimental
Augie Fackler <augie@google.com>
parents:
diff changeset
55
3a333a582d7b remotefilelog: import pruned-down remotefilelog extension from hg-experimental
Augie Fackler <augie@google.com>
parents:
diff changeset
56 $ hg cat -r 0 z
3a333a582d7b remotefilelog: import pruned-down remotefilelog extension from hg-experimental
Augie Fackler <augie@google.com>
parents:
diff changeset
57 z
3a333a582d7b remotefilelog: import pruned-down remotefilelog extension from hg-experimental
Augie Fackler <augie@google.com>
parents:
diff changeset
58 1 files fetched over 1 fetches - (1 misses, 0.00% hit ratio) over *s (glob)
3a333a582d7b remotefilelog: import pruned-down remotefilelog extension from hg-experimental
Augie Fackler <augie@google.com>
parents:
diff changeset
59
3a333a582d7b remotefilelog: import pruned-down remotefilelog extension from hg-experimental
Augie Fackler <augie@google.com>
parents:
diff changeset
60 $ hg prefetch -r 0::1 --base 0
3a333a582d7b remotefilelog: import pruned-down remotefilelog extension from hg-experimental
Augie Fackler <augie@google.com>
parents:
diff changeset
61 $ hg prefetch -r 0::1 -b 1
3a333a582d7b remotefilelog: import pruned-down remotefilelog extension from hg-experimental
Augie Fackler <augie@google.com>
parents:
diff changeset
62 $ hg prefetch -r 0::1
3a333a582d7b remotefilelog: import pruned-down remotefilelog extension from hg-experimental
Augie Fackler <augie@google.com>
parents:
diff changeset
63
3a333a582d7b remotefilelog: import pruned-down remotefilelog extension from hg-experimental
Augie Fackler <augie@google.com>
parents:
diff changeset
64 # prefetch a range of revisions
3a333a582d7b remotefilelog: import pruned-down remotefilelog extension from hg-experimental
Augie Fackler <augie@google.com>
parents:
diff changeset
65
3a333a582d7b remotefilelog: import pruned-down remotefilelog extension from hg-experimental
Augie Fackler <augie@google.com>
parents:
diff changeset
66 $ clearcache
3a333a582d7b remotefilelog: import pruned-down remotefilelog extension from hg-experimental
Augie Fackler <augie@google.com>
parents:
diff changeset
67 $ hg prefetch -r 0::1
3a333a582d7b remotefilelog: import pruned-down remotefilelog extension from hg-experimental
Augie Fackler <augie@google.com>
parents:
diff changeset
68 4 files fetched over 1 fetches - (4 misses, 0.00% hit ratio) over *s (glob)
3a333a582d7b remotefilelog: import pruned-down remotefilelog extension from hg-experimental
Augie Fackler <augie@google.com>
parents:
diff changeset
69
3a333a582d7b remotefilelog: import pruned-down remotefilelog extension from hg-experimental
Augie Fackler <augie@google.com>
parents:
diff changeset
70 $ hg cat -r 0 x
3a333a582d7b remotefilelog: import pruned-down remotefilelog extension from hg-experimental
Augie Fackler <augie@google.com>
parents:
diff changeset
71 x
3a333a582d7b remotefilelog: import pruned-down remotefilelog extension from hg-experimental
Augie Fackler <augie@google.com>
parents:
diff changeset
72 $ hg cat -r 1 x
3a333a582d7b remotefilelog: import pruned-down remotefilelog extension from hg-experimental
Augie Fackler <augie@google.com>
parents:
diff changeset
73 x2
3a333a582d7b remotefilelog: import pruned-down remotefilelog extension from hg-experimental
Augie Fackler <augie@google.com>
parents:
diff changeset
74
3a333a582d7b remotefilelog: import pruned-down remotefilelog extension from hg-experimental
Augie Fackler <augie@google.com>
parents:
diff changeset
75 # prefetch certain files
3a333a582d7b remotefilelog: import pruned-down remotefilelog extension from hg-experimental
Augie Fackler <augie@google.com>
parents:
diff changeset
76
3a333a582d7b remotefilelog: import pruned-down remotefilelog extension from hg-experimental
Augie Fackler <augie@google.com>
parents:
diff changeset
77 $ clearcache
3a333a582d7b remotefilelog: import pruned-down remotefilelog extension from hg-experimental
Augie Fackler <augie@google.com>
parents:
diff changeset
78 $ hg prefetch -r 1 x
3a333a582d7b remotefilelog: import pruned-down remotefilelog extension from hg-experimental
Augie Fackler <augie@google.com>
parents:
diff changeset
79 1 files fetched over 1 fetches - (1 misses, 0.00% hit ratio) over *s (glob)
3a333a582d7b remotefilelog: import pruned-down remotefilelog extension from hg-experimental
Augie Fackler <augie@google.com>
parents:
diff changeset
80
3a333a582d7b remotefilelog: import pruned-down remotefilelog extension from hg-experimental
Augie Fackler <augie@google.com>
parents:
diff changeset
81 $ hg cat -r 1 x
3a333a582d7b remotefilelog: import pruned-down remotefilelog extension from hg-experimental
Augie Fackler <augie@google.com>
parents:
diff changeset
82 x2
3a333a582d7b remotefilelog: import pruned-down remotefilelog extension from hg-experimental
Augie Fackler <augie@google.com>
parents:
diff changeset
83
3a333a582d7b remotefilelog: import pruned-down remotefilelog extension from hg-experimental
Augie Fackler <augie@google.com>
parents:
diff changeset
84 $ hg cat -r 1 y
3a333a582d7b remotefilelog: import pruned-down remotefilelog extension from hg-experimental
Augie Fackler <augie@google.com>
parents:
diff changeset
85 y
3a333a582d7b remotefilelog: import pruned-down remotefilelog extension from hg-experimental
Augie Fackler <augie@google.com>
parents:
diff changeset
86 1 files fetched over 1 fetches - (1 misses, 0.00% hit ratio) over *s (glob)
3a333a582d7b remotefilelog: import pruned-down remotefilelog extension from hg-experimental
Augie Fackler <augie@google.com>
parents:
diff changeset
87
3a333a582d7b remotefilelog: import pruned-down remotefilelog extension from hg-experimental
Augie Fackler <augie@google.com>
parents:
diff changeset
88 # prefetch on pull when configured
3a333a582d7b remotefilelog: import pruned-down remotefilelog extension from hg-experimental
Augie Fackler <augie@google.com>
parents:
diff changeset
89
3a333a582d7b remotefilelog: import pruned-down remotefilelog extension from hg-experimental
Augie Fackler <augie@google.com>
parents:
diff changeset
90 $ printf "[remotefilelog]\npullprefetch=bookmark()\n" >> .hg/hgrc
3a333a582d7b remotefilelog: import pruned-down remotefilelog extension from hg-experimental
Augie Fackler <augie@google.com>
parents:
diff changeset
91 $ hg strip tip
3a333a582d7b remotefilelog: import pruned-down remotefilelog extension from hg-experimental
Augie Fackler <augie@google.com>
parents:
diff changeset
92 saved backup bundle to $TESTTMP/shallow/.hg/strip-backup/109c3a557a73-3f43405e-backup.hg (glob)
46847
47a9527731c3 remotefilelog: include file contents in bundles produced during strip
Kyle Lippincott <spectral@google.com>
parents: 46418
diff changeset
93 1 files fetched over 1 fetches - (1 misses, 0.00% hit ratio) over *s (glob)
40495
3a333a582d7b remotefilelog: import pruned-down remotefilelog extension from hg-experimental
Augie Fackler <augie@google.com>
parents:
diff changeset
94
3a333a582d7b remotefilelog: import pruned-down remotefilelog extension from hg-experimental
Augie Fackler <augie@google.com>
parents:
diff changeset
95 $ clearcache
3a333a582d7b remotefilelog: import pruned-down remotefilelog extension from hg-experimental
Augie Fackler <augie@google.com>
parents:
diff changeset
96 $ hg pull
3a333a582d7b remotefilelog: import pruned-down remotefilelog extension from hg-experimental
Augie Fackler <augie@google.com>
parents:
diff changeset
97 pulling from ssh://user@dummy/master
3a333a582d7b remotefilelog: import pruned-down remotefilelog extension from hg-experimental
Augie Fackler <augie@google.com>
parents:
diff changeset
98 searching for changes
3a333a582d7b remotefilelog: import pruned-down remotefilelog extension from hg-experimental
Augie Fackler <augie@google.com>
parents:
diff changeset
99 adding changesets
3a333a582d7b remotefilelog: import pruned-down remotefilelog extension from hg-experimental
Augie Fackler <augie@google.com>
parents:
diff changeset
100 adding manifests
3a333a582d7b remotefilelog: import pruned-down remotefilelog extension from hg-experimental
Augie Fackler <augie@google.com>
parents:
diff changeset
101 adding file changes
42897
d7304434390f changegroup: move message about added changes to transaction summary
Pierre-Yves David <pierre-yves.david@octobus.net>
parents: 42092
diff changeset
102 updating bookmark foo
40495
3a333a582d7b remotefilelog: import pruned-down remotefilelog extension from hg-experimental
Augie Fackler <augie@google.com>
parents:
diff changeset
103 added 1 changesets with 0 changes to 0 files
3a333a582d7b remotefilelog: import pruned-down remotefilelog extension from hg-experimental
Augie Fackler <augie@google.com>
parents:
diff changeset
104 new changesets 109c3a557a73
3a333a582d7b remotefilelog: import pruned-down remotefilelog extension from hg-experimental
Augie Fackler <augie@google.com>
parents:
diff changeset
105 (run 'hg update' to get a working copy)
3a333a582d7b remotefilelog: import pruned-down remotefilelog extension from hg-experimental
Augie Fackler <augie@google.com>
parents:
diff changeset
106 prefetching file contents
3a333a582d7b remotefilelog: import pruned-down remotefilelog extension from hg-experimental
Augie Fackler <augie@google.com>
parents:
diff changeset
107 3 files fetched over 1 fetches - (3 misses, 0.00% hit ratio) over *s (glob)
3a333a582d7b remotefilelog: import pruned-down remotefilelog extension from hg-experimental
Augie Fackler <augie@google.com>
parents:
diff changeset
108
3a333a582d7b remotefilelog: import pruned-down remotefilelog extension from hg-experimental
Augie Fackler <augie@google.com>
parents:
diff changeset
109 $ hg up tip
3a333a582d7b remotefilelog: import pruned-down remotefilelog extension from hg-experimental
Augie Fackler <augie@google.com>
parents:
diff changeset
110 3 files updated, 0 files merged, 0 files removed, 0 files unresolved
3a333a582d7b remotefilelog: import pruned-down remotefilelog extension from hg-experimental
Augie Fackler <augie@google.com>
parents:
diff changeset
111
3a333a582d7b remotefilelog: import pruned-down remotefilelog extension from hg-experimental
Augie Fackler <augie@google.com>
parents:
diff changeset
112 # prefetch only fetches changes not in working copy
3a333a582d7b remotefilelog: import pruned-down remotefilelog extension from hg-experimental
Augie Fackler <augie@google.com>
parents:
diff changeset
113
3a333a582d7b remotefilelog: import pruned-down remotefilelog extension from hg-experimental
Augie Fackler <augie@google.com>
parents:
diff changeset
114 $ hg strip tip
3a333a582d7b remotefilelog: import pruned-down remotefilelog extension from hg-experimental
Augie Fackler <augie@google.com>
parents:
diff changeset
115 1 files updated, 0 files merged, 1 files removed, 0 files unresolved
3a333a582d7b remotefilelog: import pruned-down remotefilelog extension from hg-experimental
Augie Fackler <augie@google.com>
parents:
diff changeset
116 saved backup bundle to $TESTTMP/shallow/.hg/strip-backup/109c3a557a73-3f43405e-backup.hg (glob)
3a333a582d7b remotefilelog: import pruned-down remotefilelog extension from hg-experimental
Augie Fackler <augie@google.com>
parents:
diff changeset
117 1 files fetched over 1 fetches - (1 misses, 0.00% hit ratio) over *s (glob)
3a333a582d7b remotefilelog: import pruned-down remotefilelog extension from hg-experimental
Augie Fackler <augie@google.com>
parents:
diff changeset
118 $ clearcache
3a333a582d7b remotefilelog: import pruned-down remotefilelog extension from hg-experimental
Augie Fackler <augie@google.com>
parents:
diff changeset
119
3a333a582d7b remotefilelog: import pruned-down remotefilelog extension from hg-experimental
Augie Fackler <augie@google.com>
parents:
diff changeset
120 $ hg pull
3a333a582d7b remotefilelog: import pruned-down remotefilelog extension from hg-experimental
Augie Fackler <augie@google.com>
parents:
diff changeset
121 pulling from ssh://user@dummy/master
3a333a582d7b remotefilelog: import pruned-down remotefilelog extension from hg-experimental
Augie Fackler <augie@google.com>
parents:
diff changeset
122 searching for changes
3a333a582d7b remotefilelog: import pruned-down remotefilelog extension from hg-experimental
Augie Fackler <augie@google.com>
parents:
diff changeset
123 adding changesets
3a333a582d7b remotefilelog: import pruned-down remotefilelog extension from hg-experimental
Augie Fackler <augie@google.com>
parents:
diff changeset
124 adding manifests
3a333a582d7b remotefilelog: import pruned-down remotefilelog extension from hg-experimental
Augie Fackler <augie@google.com>
parents:
diff changeset
125 adding file changes
42897
d7304434390f changegroup: move message about added changes to transaction summary
Pierre-Yves David <pierre-yves.david@octobus.net>
parents: 42092
diff changeset
126 updating bookmark foo
40495
3a333a582d7b remotefilelog: import pruned-down remotefilelog extension from hg-experimental
Augie Fackler <augie@google.com>
parents:
diff changeset
127 added 1 changesets with 0 changes to 0 files
3a333a582d7b remotefilelog: import pruned-down remotefilelog extension from hg-experimental
Augie Fackler <augie@google.com>
parents:
diff changeset
128 new changesets 109c3a557a73
3a333a582d7b remotefilelog: import pruned-down remotefilelog extension from hg-experimental
Augie Fackler <augie@google.com>
parents:
diff changeset
129 (run 'hg update' to get a working copy)
3a333a582d7b remotefilelog: import pruned-down remotefilelog extension from hg-experimental
Augie Fackler <augie@google.com>
parents:
diff changeset
130 prefetching file contents
3a333a582d7b remotefilelog: import pruned-down remotefilelog extension from hg-experimental
Augie Fackler <augie@google.com>
parents:
diff changeset
131 2 files fetched over 1 fetches - (2 misses, 0.00% hit ratio) over *s (glob)
3a333a582d7b remotefilelog: import pruned-down remotefilelog extension from hg-experimental
Augie Fackler <augie@google.com>
parents:
diff changeset
132
3a333a582d7b remotefilelog: import pruned-down remotefilelog extension from hg-experimental
Augie Fackler <augie@google.com>
parents:
diff changeset
133 # Make some local commits that produce the same file versions as are on the
3a333a582d7b remotefilelog: import pruned-down remotefilelog extension from hg-experimental
Augie Fackler <augie@google.com>
parents:
diff changeset
134 # server. To simulate a situation where we have local commits that were somehow
3a333a582d7b remotefilelog: import pruned-down remotefilelog extension from hg-experimental
Augie Fackler <augie@google.com>
parents:
diff changeset
135 # pushed, and we will soon pull.
3a333a582d7b remotefilelog: import pruned-down remotefilelog extension from hg-experimental
Augie Fackler <augie@google.com>
parents:
diff changeset
136
3a333a582d7b remotefilelog: import pruned-down remotefilelog extension from hg-experimental
Augie Fackler <augie@google.com>
parents:
diff changeset
137 $ hg prefetch -r 'all()'
3a333a582d7b remotefilelog: import pruned-down remotefilelog extension from hg-experimental
Augie Fackler <augie@google.com>
parents:
diff changeset
138 2 files fetched over 1 fetches - (2 misses, 0.00% hit ratio) over *s (glob)
3a333a582d7b remotefilelog: import pruned-down remotefilelog extension from hg-experimental
Augie Fackler <augie@google.com>
parents:
diff changeset
139 $ hg strip -q -r 0
3a333a582d7b remotefilelog: import pruned-down remotefilelog extension from hg-experimental
Augie Fackler <augie@google.com>
parents:
diff changeset
140 $ echo x > x
3a333a582d7b remotefilelog: import pruned-down remotefilelog extension from hg-experimental
Augie Fackler <augie@google.com>
parents:
diff changeset
141 $ echo z > z
3a333a582d7b remotefilelog: import pruned-down remotefilelog extension from hg-experimental
Augie Fackler <augie@google.com>
parents:
diff changeset
142 $ hg commit -qAm x
3a333a582d7b remotefilelog: import pruned-down remotefilelog extension from hg-experimental
Augie Fackler <augie@google.com>
parents:
diff changeset
143 $ echo x2 > x
3a333a582d7b remotefilelog: import pruned-down remotefilelog extension from hg-experimental
Augie Fackler <augie@google.com>
parents:
diff changeset
144 $ echo y > y
3a333a582d7b remotefilelog: import pruned-down remotefilelog extension from hg-experimental
Augie Fackler <augie@google.com>
parents:
diff changeset
145 $ hg commit -qAm y
3a333a582d7b remotefilelog: import pruned-down remotefilelog extension from hg-experimental
Augie Fackler <augie@google.com>
parents:
diff changeset
146
3a333a582d7b remotefilelog: import pruned-down remotefilelog extension from hg-experimental
Augie Fackler <augie@google.com>
parents:
diff changeset
147 # prefetch server versions, even if local versions are available
3a333a582d7b remotefilelog: import pruned-down remotefilelog extension from hg-experimental
Augie Fackler <augie@google.com>
parents:
diff changeset
148
3a333a582d7b remotefilelog: import pruned-down remotefilelog extension from hg-experimental
Augie Fackler <augie@google.com>
parents:
diff changeset
149 $ clearcache
3a333a582d7b remotefilelog: import pruned-down remotefilelog extension from hg-experimental
Augie Fackler <augie@google.com>
parents:
diff changeset
150 $ hg strip -q tip
3a333a582d7b remotefilelog: import pruned-down remotefilelog extension from hg-experimental
Augie Fackler <augie@google.com>
parents:
diff changeset
151 $ hg pull
3a333a582d7b remotefilelog: import pruned-down remotefilelog extension from hg-experimental
Augie Fackler <augie@google.com>
parents:
diff changeset
152 pulling from ssh://user@dummy/master
3a333a582d7b remotefilelog: import pruned-down remotefilelog extension from hg-experimental
Augie Fackler <augie@google.com>
parents:
diff changeset
153 searching for changes
3a333a582d7b remotefilelog: import pruned-down remotefilelog extension from hg-experimental
Augie Fackler <augie@google.com>
parents:
diff changeset
154 adding changesets
3a333a582d7b remotefilelog: import pruned-down remotefilelog extension from hg-experimental
Augie Fackler <augie@google.com>
parents:
diff changeset
155 adding manifests
3a333a582d7b remotefilelog: import pruned-down remotefilelog extension from hg-experimental
Augie Fackler <augie@google.com>
parents:
diff changeset
156 adding file changes
42897
d7304434390f changegroup: move message about added changes to transaction summary
Pierre-Yves David <pierre-yves.david@octobus.net>
parents: 42092
diff changeset
157 updating bookmark foo
40495
3a333a582d7b remotefilelog: import pruned-down remotefilelog extension from hg-experimental
Augie Fackler <augie@google.com>
parents:
diff changeset
158 added 1 changesets with 0 changes to 0 files
3a333a582d7b remotefilelog: import pruned-down remotefilelog extension from hg-experimental
Augie Fackler <augie@google.com>
parents:
diff changeset
159 new changesets 109c3a557a73
3a333a582d7b remotefilelog: import pruned-down remotefilelog extension from hg-experimental
Augie Fackler <augie@google.com>
parents:
diff changeset
160 1 local changesets published (?)
3a333a582d7b remotefilelog: import pruned-down remotefilelog extension from hg-experimental
Augie Fackler <augie@google.com>
parents:
diff changeset
161 (run 'hg update' to get a working copy)
3a333a582d7b remotefilelog: import pruned-down remotefilelog extension from hg-experimental
Augie Fackler <augie@google.com>
parents:
diff changeset
162 prefetching file contents
3a333a582d7b remotefilelog: import pruned-down remotefilelog extension from hg-experimental
Augie Fackler <augie@google.com>
parents:
diff changeset
163 2 files fetched over 1 fetches - (2 misses, 0.00% hit ratio) over *s (glob)
3a333a582d7b remotefilelog: import pruned-down remotefilelog extension from hg-experimental
Augie Fackler <augie@google.com>
parents:
diff changeset
164
3a333a582d7b remotefilelog: import pruned-down remotefilelog extension from hg-experimental
Augie Fackler <augie@google.com>
parents:
diff changeset
165 $ cd ..
3a333a582d7b remotefilelog: import pruned-down remotefilelog extension from hg-experimental
Augie Fackler <augie@google.com>
parents:
diff changeset
166
3a333a582d7b remotefilelog: import pruned-down remotefilelog extension from hg-experimental
Augie Fackler <augie@google.com>
parents:
diff changeset
167 # Prefetch unknown files during checkout
3a333a582d7b remotefilelog: import pruned-down remotefilelog extension from hg-experimental
Augie Fackler <augie@google.com>
parents:
diff changeset
168
3a333a582d7b remotefilelog: import pruned-down remotefilelog extension from hg-experimental
Augie Fackler <augie@google.com>
parents:
diff changeset
169 $ hgcloneshallow ssh://user@dummy/master shallow2
3a333a582d7b remotefilelog: import pruned-down remotefilelog extension from hg-experimental
Augie Fackler <augie@google.com>
parents:
diff changeset
170 streaming all changes
51181
dcaa2df1f688 changelog: never inline changelog
Pierre-Yves David <pierre-yves.david@octobus.net>
parents: 47127
diff changeset
171 3 files to transfer, 528 bytes of data (no-zstd !)
46874
84a93fa7ecfd revlog-compression: use zstd by default (if available)
Pierre-Yves David <pierre-yves.david@octobus.net>
parents: 46847
diff changeset
172 transferred 528 bytes in * seconds * (glob) (no-zstd !)
51181
dcaa2df1f688 changelog: never inline changelog
Pierre-Yves David <pierre-yves.david@octobus.net>
parents: 47127
diff changeset
173 3 files to transfer, 532 bytes of data (zstd no-rust !)
dcaa2df1f688 changelog: never inline changelog
Pierre-Yves David <pierre-yves.david@octobus.net>
parents: 47127
diff changeset
174 transferred 532 bytes in * seconds (* */sec) (glob) (zstd no-rust !)
dcaa2df1f688 changelog: never inline changelog
Pierre-Yves David <pierre-yves.david@octobus.net>
parents: 47127
diff changeset
175 5 files to transfer, 658 bytes of data (zstd rust !)
dcaa2df1f688 changelog: never inline changelog
Pierre-Yves David <pierre-yves.david@octobus.net>
parents: 47127
diff changeset
176 transferred 658 bytes in * seconds (*/sec) (glob) (zstd rust !)
40495
3a333a582d7b remotefilelog: import pruned-down remotefilelog extension from hg-experimental
Augie Fackler <augie@google.com>
parents:
diff changeset
177 searching for changes
3a333a582d7b remotefilelog: import pruned-down remotefilelog extension from hg-experimental
Augie Fackler <augie@google.com>
parents:
diff changeset
178 no changes found
3a333a582d7b remotefilelog: import pruned-down remotefilelog extension from hg-experimental
Augie Fackler <augie@google.com>
parents:
diff changeset
179 updating to branch default
3a333a582d7b remotefilelog: import pruned-down remotefilelog extension from hg-experimental
Augie Fackler <augie@google.com>
parents:
diff changeset
180 3 files updated, 0 files merged, 0 files removed, 0 files unresolved
3a333a582d7b remotefilelog: import pruned-down remotefilelog extension from hg-experimental
Augie Fackler <augie@google.com>
parents:
diff changeset
181 1 files fetched over 1 fetches - (1 misses, 0.00% hit ratio) over * (glob)
3a333a582d7b remotefilelog: import pruned-down remotefilelog extension from hg-experimental
Augie Fackler <augie@google.com>
parents:
diff changeset
182 $ cd shallow2
3a333a582d7b remotefilelog: import pruned-down remotefilelog extension from hg-experimental
Augie Fackler <augie@google.com>
parents:
diff changeset
183 $ hg up -q null
3a333a582d7b remotefilelog: import pruned-down remotefilelog extension from hg-experimental
Augie Fackler <augie@google.com>
parents:
diff changeset
184 $ echo x > x
3a333a582d7b remotefilelog: import pruned-down remotefilelog extension from hg-experimental
Augie Fackler <augie@google.com>
parents:
diff changeset
185 $ echo y > y
3a333a582d7b remotefilelog: import pruned-down remotefilelog extension from hg-experimental
Augie Fackler <augie@google.com>
parents:
diff changeset
186 $ echo z > z
3a333a582d7b remotefilelog: import pruned-down remotefilelog extension from hg-experimental
Augie Fackler <augie@google.com>
parents:
diff changeset
187 $ clearcache
3a333a582d7b remotefilelog: import pruned-down remotefilelog extension from hg-experimental
Augie Fackler <augie@google.com>
parents:
diff changeset
188 $ hg up tip
3a333a582d7b remotefilelog: import pruned-down remotefilelog extension from hg-experimental
Augie Fackler <augie@google.com>
parents:
diff changeset
189 x: untracked file differs
3a333a582d7b remotefilelog: import pruned-down remotefilelog extension from hg-experimental
Augie Fackler <augie@google.com>
parents:
diff changeset
190 3 files fetched over 1 fetches - (3 misses, 0.00% hit ratio) over * (glob)
3a333a582d7b remotefilelog: import pruned-down remotefilelog extension from hg-experimental
Augie Fackler <augie@google.com>
parents:
diff changeset
191 abort: untracked files in working directory differ from files in requested revision
46418
dc00324e80f4 errors: use StateError more in merge module
Martin von Zweigbergk <martinvonz@google.com>
parents: 45907
diff changeset
192 [20]
40495
3a333a582d7b remotefilelog: import pruned-down remotefilelog extension from hg-experimental
Augie Fackler <augie@google.com>
parents:
diff changeset
193 $ hg revert --all
3a333a582d7b remotefilelog: import pruned-down remotefilelog extension from hg-experimental
Augie Fackler <augie@google.com>
parents:
diff changeset
194
3a333a582d7b remotefilelog: import pruned-down remotefilelog extension from hg-experimental
Augie Fackler <augie@google.com>
parents:
diff changeset
195 # Test batch fetching of lookup files during hg status
3a333a582d7b remotefilelog: import pruned-down remotefilelog extension from hg-experimental
Augie Fackler <augie@google.com>
parents:
diff changeset
196 $ hg up --clean tip
3a333a582d7b remotefilelog: import pruned-down remotefilelog extension from hg-experimental
Augie Fackler <augie@google.com>
parents:
diff changeset
197 3 files updated, 0 files merged, 0 files removed, 0 files unresolved
3a333a582d7b remotefilelog: import pruned-down remotefilelog extension from hg-experimental
Augie Fackler <augie@google.com>
parents:
diff changeset
198 $ hg debugrebuilddirstate
3a333a582d7b remotefilelog: import pruned-down remotefilelog extension from hg-experimental
Augie Fackler <augie@google.com>
parents:
diff changeset
199 $ clearcache
3a333a582d7b remotefilelog: import pruned-down remotefilelog extension from hg-experimental
Augie Fackler <augie@google.com>
parents:
diff changeset
200 $ hg status
3a333a582d7b remotefilelog: import pruned-down remotefilelog extension from hg-experimental
Augie Fackler <augie@google.com>
parents:
diff changeset
201 3 files fetched over 1 fetches - (3 misses, 0.00% hit ratio) over * (glob)
3a333a582d7b remotefilelog: import pruned-down remotefilelog extension from hg-experimental
Augie Fackler <augie@google.com>
parents:
diff changeset
202
3a333a582d7b remotefilelog: import pruned-down remotefilelog extension from hg-experimental
Augie Fackler <augie@google.com>
parents:
diff changeset
203 # Prefetch during addrename detection
3a333a582d7b remotefilelog: import pruned-down remotefilelog extension from hg-experimental
Augie Fackler <augie@google.com>
parents:
diff changeset
204 $ hg up -q --clean tip
3a333a582d7b remotefilelog: import pruned-down remotefilelog extension from hg-experimental
Augie Fackler <augie@google.com>
parents:
diff changeset
205 $ hg revert --all
3a333a582d7b remotefilelog: import pruned-down remotefilelog extension from hg-experimental
Augie Fackler <augie@google.com>
parents:
diff changeset
206 $ mv x x2
3a333a582d7b remotefilelog: import pruned-down remotefilelog extension from hg-experimental
Augie Fackler <augie@google.com>
parents:
diff changeset
207 $ mv y y2
3a333a582d7b remotefilelog: import pruned-down remotefilelog extension from hg-experimental
Augie Fackler <augie@google.com>
parents:
diff changeset
208 $ mv z z2
42092
91cc8dc866ed remotefilelog: fix crash on `hg addremove` of added-but-deleted file
Martin von Zweigbergk <martinvonz@google.com>
parents: 40722
diff changeset
209 $ echo a > a
91cc8dc866ed remotefilelog: fix crash on `hg addremove` of added-but-deleted file
Martin von Zweigbergk <martinvonz@google.com>
parents: 40722
diff changeset
210 $ hg add a
91cc8dc866ed remotefilelog: fix crash on `hg addremove` of added-but-deleted file
Martin von Zweigbergk <martinvonz@google.com>
parents: 40722
diff changeset
211 $ rm a
40495
3a333a582d7b remotefilelog: import pruned-down remotefilelog extension from hg-experimental
Augie Fackler <augie@google.com>
parents:
diff changeset
212 $ clearcache
3a333a582d7b remotefilelog: import pruned-down remotefilelog extension from hg-experimental
Augie Fackler <augie@google.com>
parents:
diff changeset
213 $ hg addremove -s 50 > /dev/null
3a333a582d7b remotefilelog: import pruned-down remotefilelog extension from hg-experimental
Augie Fackler <augie@google.com>
parents:
diff changeset
214 3 files fetched over 1 fetches - (3 misses, 0.00% hit ratio) over * (glob)
40502
6d64e2abe8d3 remotefilelog: remove support for fetching packs
Augie Fackler <augie@google.com>
parents: 40495
diff changeset
215 $ hg revert --all
6d64e2abe8d3 remotefilelog: remove support for fetching packs
Augie Fackler <augie@google.com>
parents: 40495
diff changeset
216 forgetting x2
6d64e2abe8d3 remotefilelog: remove support for fetching packs
Augie Fackler <augie@google.com>
parents: 40495
diff changeset
217 forgetting y2
6d64e2abe8d3 remotefilelog: remove support for fetching packs
Augie Fackler <augie@google.com>
parents: 40495
diff changeset
218 forgetting z2
6d64e2abe8d3 remotefilelog: remove support for fetching packs
Augie Fackler <augie@google.com>
parents: 40495
diff changeset
219 undeleting x
6d64e2abe8d3 remotefilelog: remove support for fetching packs
Augie Fackler <augie@google.com>
parents: 40495
diff changeset
220 undeleting y
6d64e2abe8d3 remotefilelog: remove support for fetching packs
Augie Fackler <augie@google.com>
parents: 40495
diff changeset
221 undeleting z
40495
3a333a582d7b remotefilelog: import pruned-down remotefilelog extension from hg-experimental
Augie Fackler <augie@google.com>
parents:
diff changeset
222
3a333a582d7b remotefilelog: import pruned-down remotefilelog extension from hg-experimental
Augie Fackler <augie@google.com>
parents:
diff changeset
223
3a333a582d7b remotefilelog: import pruned-down remotefilelog extension from hg-experimental
Augie Fackler <augie@google.com>
parents:
diff changeset
224 # Revert across double renames. Note: the scary "abort", error is because
3a333a582d7b remotefilelog: import pruned-down remotefilelog extension from hg-experimental
Augie Fackler <augie@google.com>
parents:
diff changeset
225 # https://bz.mercurial-scm.org/5419 .
3a333a582d7b remotefilelog: import pruned-down remotefilelog extension from hg-experimental
Augie Fackler <augie@google.com>
parents:
diff changeset
226
40502
6d64e2abe8d3 remotefilelog: remove support for fetching packs
Augie Fackler <augie@google.com>
parents: 40495
diff changeset
227 $ cd ../master
6d64e2abe8d3 remotefilelog: remove support for fetching packs
Augie Fackler <augie@google.com>
parents: 40495
diff changeset
228 $ hg mv z z2
6d64e2abe8d3 remotefilelog: remove support for fetching packs
Augie Fackler <augie@google.com>
parents: 40495
diff changeset
229 $ hg commit -m 'move z -> z2'
6d64e2abe8d3 remotefilelog: remove support for fetching packs
Augie Fackler <augie@google.com>
parents: 40495
diff changeset
230 $ cd ../shallow2
6d64e2abe8d3 remotefilelog: remove support for fetching packs
Augie Fackler <augie@google.com>
parents: 40495
diff changeset
231 $ hg pull -q
40495
3a333a582d7b remotefilelog: import pruned-down remotefilelog extension from hg-experimental
Augie Fackler <augie@google.com>
parents:
diff changeset
232 $ clearcache
3a333a582d7b remotefilelog: import pruned-down remotefilelog extension from hg-experimental
Augie Fackler <augie@google.com>
parents:
diff changeset
233 $ hg mv y y2
40502
6d64e2abe8d3 remotefilelog: remove support for fetching packs
Augie Fackler <augie@google.com>
parents: 40495
diff changeset
234 y2: not overwriting - file exists
6d64e2abe8d3 remotefilelog: remove support for fetching packs
Augie Fackler <augie@google.com>
parents: 40495
diff changeset
235 ('hg rename --after' to record the rename)
6d64e2abe8d3 remotefilelog: remove support for fetching packs
Augie Fackler <augie@google.com>
parents: 40495
diff changeset
236 [1]
40495
3a333a582d7b remotefilelog: import pruned-down remotefilelog extension from hg-experimental
Augie Fackler <augie@google.com>
parents:
diff changeset
237 $ hg mv x x2
40502
6d64e2abe8d3 remotefilelog: remove support for fetching packs
Augie Fackler <augie@google.com>
parents: 40495
diff changeset
238 x2: not overwriting - file exists
6d64e2abe8d3 remotefilelog: remove support for fetching packs
Augie Fackler <augie@google.com>
parents: 40495
diff changeset
239 ('hg rename --after' to record the rename)
6d64e2abe8d3 remotefilelog: remove support for fetching packs
Augie Fackler <augie@google.com>
parents: 40495
diff changeset
240 [1]
40495
3a333a582d7b remotefilelog: import pruned-down remotefilelog extension from hg-experimental
Augie Fackler <augie@google.com>
parents:
diff changeset
241 $ hg mv z2 z3
40502
6d64e2abe8d3 remotefilelog: remove support for fetching packs
Augie Fackler <augie@google.com>
parents: 40495
diff changeset
242 z2: not copying - file is not managed
6d64e2abe8d3 remotefilelog: remove support for fetching packs
Augie Fackler <augie@google.com>
parents: 40495
diff changeset
243 abort: no files to copy
47127
5ffc6c18fb96 rename: add hint about --at-rev if source file doesn't exist
Martin von Zweigbergk <martinvonz@google.com>
parents: 46874
diff changeset
244 (maybe you meant to use --after --at-rev=.)
45827
8d72e29ad1e0 errors: introduce InputError and use it from commands and cmdutil
Martin von Zweigbergk <martinvonz@google.com>
parents: 44403
diff changeset
245 [10]
44403
fca7caeaa6e7 remotefilelog-test: glob some flaky output line
Pierre-Yves David <pierre-yves.david@octobus.net>
parents: 44016
diff changeset
246 $ find $CACHEDIR -type f | sort
fca7caeaa6e7 remotefilelog-test: glob some flaky output line
Pierre-Yves David <pierre-yves.david@octobus.net>
parents: 44016
diff changeset
247 .. The following output line about files fetches is globed because it is
fca7caeaa6e7 remotefilelog-test: glob some flaky output line
Pierre-Yves David <pierre-yves.david@octobus.net>
parents: 44016
diff changeset
248 .. flaky, the core the test is checked when checking the cache dir, so
fca7caeaa6e7 remotefilelog-test: glob some flaky output line
Pierre-Yves David <pierre-yves.david@octobus.net>
parents: 44016
diff changeset
249 .. hopefully this flakyness is not hiding any actual bug.
40495
3a333a582d7b remotefilelog: import pruned-down remotefilelog extension from hg-experimental
Augie Fackler <augie@google.com>
parents:
diff changeset
250 $ hg revert -a -r 1 || true
44403
fca7caeaa6e7 remotefilelog-test: glob some flaky output line
Pierre-Yves David <pierre-yves.david@octobus.net>
parents: 44016
diff changeset
251 ? files fetched over 1 fetches - (? misses, 0.00% hit ratio) over * (glob)
45907
50afeeeb7b79 errors: consistently don't use trailing "!" in "not found in manifest" message
Martin von Zweigbergk <martinvonz@google.com>
parents: 45827
diff changeset
252 abort: z2@109c3a557a73: not found in manifest (?)
44403
fca7caeaa6e7 remotefilelog-test: glob some flaky output line
Pierre-Yves David <pierre-yves.david@octobus.net>
parents: 44016
diff changeset
253 $ find $CACHEDIR -type f | sort
fca7caeaa6e7 remotefilelog-test: glob some flaky output line
Pierre-Yves David <pierre-yves.david@octobus.net>
parents: 44016
diff changeset
254 $TESTTMP/hgcache/master/11/f6ad8ec52a2984abaafd7c3b516503785c2072/ef95c5376f34698742fe34f315fd82136f8f68c0
fca7caeaa6e7 remotefilelog-test: glob some flaky output line
Pierre-Yves David <pierre-yves.david@octobus.net>
parents: 44016
diff changeset
255 $TESTTMP/hgcache/master/39/5df8f7c51f007019cb30201c49e884b46b92fa/69a1b67522704ec122181c0890bd16e9d3e7516a
fca7caeaa6e7 remotefilelog-test: glob some flaky output line
Pierre-Yves David <pierre-yves.david@octobus.net>
parents: 44016
diff changeset
256 $TESTTMP/hgcache/master/95/cb0bfd2977c761298d9624e4b4d4c72a39974a/076f5e2225b3ff0400b98c92aa6cdf403ee24cca
fca7caeaa6e7 remotefilelog-test: glob some flaky output line
Pierre-Yves David <pierre-yves.david@octobus.net>
parents: 44016
diff changeset
257 $TESTTMP/hgcache/repos
44001
faf00e30b63f remotefilelog: actually fix (and test this time) a bytes vs str issue
Kyle Lippincott <spectral@google.com>
parents: 42897
diff changeset
258
faf00e30b63f remotefilelog: actually fix (and test this time) a bytes vs str issue
Kyle Lippincott <spectral@google.com>
parents: 42897
diff changeset
259 # warning when we have excess remotefilelog fetching
faf00e30b63f remotefilelog: actually fix (and test this time) a bytes vs str issue
Kyle Lippincott <spectral@google.com>
parents: 42897
diff changeset
260
faf00e30b63f remotefilelog: actually fix (and test this time) a bytes vs str issue
Kyle Lippincott <spectral@google.com>
parents: 42897
diff changeset
261 $ cat > repeated_fetch.py << EOF
faf00e30b63f remotefilelog: actually fix (and test this time) a bytes vs str issue
Kyle Lippincott <spectral@google.com>
parents: 42897
diff changeset
262 > import binascii
faf00e30b63f remotefilelog: actually fix (and test this time) a bytes vs str issue
Kyle Lippincott <spectral@google.com>
parents: 42897
diff changeset
263 > from mercurial import extensions, registrar
faf00e30b63f remotefilelog: actually fix (and test this time) a bytes vs str issue
Kyle Lippincott <spectral@google.com>
parents: 42897
diff changeset
264 > cmdtable = {}
faf00e30b63f remotefilelog: actually fix (and test this time) a bytes vs str issue
Kyle Lippincott <spectral@google.com>
parents: 42897
diff changeset
265 > command = registrar.command(cmdtable)
faf00e30b63f remotefilelog: actually fix (and test this time) a bytes vs str issue
Kyle Lippincott <spectral@google.com>
parents: 42897
diff changeset
266 > @command(b'repeated-fetch', [], b'', inferrepo=True)
faf00e30b63f remotefilelog: actually fix (and test this time) a bytes vs str issue
Kyle Lippincott <spectral@google.com>
parents: 42897
diff changeset
267 > def repeated_fetch(ui, repo, *args, **opts):
faf00e30b63f remotefilelog: actually fix (and test this time) a bytes vs str issue
Kyle Lippincott <spectral@google.com>
parents: 42897
diff changeset
268 > for i in range(20):
faf00e30b63f remotefilelog: actually fix (and test this time) a bytes vs str issue
Kyle Lippincott <spectral@google.com>
parents: 42897
diff changeset
269 > try:
faf00e30b63f remotefilelog: actually fix (and test this time) a bytes vs str issue
Kyle Lippincott <spectral@google.com>
parents: 42897
diff changeset
270 > hexid = (b'%02x' % (i + 1)) * 20
faf00e30b63f remotefilelog: actually fix (and test this time) a bytes vs str issue
Kyle Lippincott <spectral@google.com>
parents: 42897
diff changeset
271 > repo.fileservice.prefetch([(b'somefile.txt', hexid)])
44016
1e0783b946c8 tests: fix a "naked exception" issue in test-remotefilelog-prefetch.t
Kyle Lippincott <spectral@google.com>
parents: 44001
diff changeset
272 > except Exception:
44001
faf00e30b63f remotefilelog: actually fix (and test this time) a bytes vs str issue
Kyle Lippincott <spectral@google.com>
parents: 42897
diff changeset
273 > pass
faf00e30b63f remotefilelog: actually fix (and test this time) a bytes vs str issue
Kyle Lippincott <spectral@google.com>
parents: 42897
diff changeset
274 > EOF
faf00e30b63f remotefilelog: actually fix (and test this time) a bytes vs str issue
Kyle Lippincott <spectral@google.com>
parents: 42897
diff changeset
275
faf00e30b63f remotefilelog: actually fix (and test this time) a bytes vs str issue
Kyle Lippincott <spectral@google.com>
parents: 42897
diff changeset
276 We should only output to the user once. We're ignoring most of the output
faf00e30b63f remotefilelog: actually fix (and test this time) a bytes vs str issue
Kyle Lippincott <spectral@google.com>
parents: 42897
diff changeset
277 because we're not actually fetching anything real here, all the hashes are
faf00e30b63f remotefilelog: actually fix (and test this time) a bytes vs str issue
Kyle Lippincott <spectral@google.com>
parents: 42897
diff changeset
278 bogus, so it's just going to be errors and a final summary of all the misses.
faf00e30b63f remotefilelog: actually fix (and test this time) a bytes vs str issue
Kyle Lippincott <spectral@google.com>
parents: 42897
diff changeset
279 $ hg --config extensions.repeated_fetch=repeated_fetch.py \
faf00e30b63f remotefilelog: actually fix (and test this time) a bytes vs str issue
Kyle Lippincott <spectral@google.com>
parents: 42897
diff changeset
280 > --config remotefilelog.fetchwarning="fetch warning!" \
faf00e30b63f remotefilelog: actually fix (and test this time) a bytes vs str issue
Kyle Lippincott <spectral@google.com>
parents: 42897
diff changeset
281 > --config extensions.blackbox= \
faf00e30b63f remotefilelog: actually fix (and test this time) a bytes vs str issue
Kyle Lippincott <spectral@google.com>
parents: 42897
diff changeset
282 > repeated-fetch 2>&1 | grep 'fetch warning'
faf00e30b63f remotefilelog: actually fix (and test this time) a bytes vs str issue
Kyle Lippincott <spectral@google.com>
parents: 42897
diff changeset
283 fetch warning!
faf00e30b63f remotefilelog: actually fix (and test this time) a bytes vs str issue
Kyle Lippincott <spectral@google.com>
parents: 42897
diff changeset
284
faf00e30b63f remotefilelog: actually fix (and test this time) a bytes vs str issue
Kyle Lippincott <spectral@google.com>
parents: 42897
diff changeset
285 We should output to blackbox three times, with a stack trace on each (though
faf00e30b63f remotefilelog: actually fix (and test this time) a bytes vs str issue
Kyle Lippincott <spectral@google.com>
parents: 42897
diff changeset
286 that isn't tested here).
faf00e30b63f remotefilelog: actually fix (and test this time) a bytes vs str issue
Kyle Lippincott <spectral@google.com>
parents: 42897
diff changeset
287 $ grep 'excess remotefilelog fetching' .hg/blackbox.log
faf00e30b63f remotefilelog: actually fix (and test this time) a bytes vs str issue
Kyle Lippincott <spectral@google.com>
parents: 42897
diff changeset
288 .* excess remotefilelog fetching: (re)
faf00e30b63f remotefilelog: actually fix (and test this time) a bytes vs str issue
Kyle Lippincott <spectral@google.com>
parents: 42897
diff changeset
289 .* excess remotefilelog fetching: (re)
faf00e30b63f remotefilelog: actually fix (and test this time) a bytes vs str issue
Kyle Lippincott <spectral@google.com>
parents: 42897
diff changeset
290 .* excess remotefilelog fetching: (re)