Mercurial > hg
annotate tests/test-push-r.t @ 26375:3686fa2b8eee
windows: insert file positioning call between reads and writes
fopen() and fdopen() have a unique-to-Windows requirement that
transitions between read and write operations in files opened
in modes r+, w+, and a+ perform a file positioning call
(fsetpos, fseek, or rewind) in between. While the MSDN docs don't
say what will happen if this is not done, observations reveal
that Python raises an IOError with errno 0. Furthermore, I
/think/ this behavior isn't deterministic. But I can reproduce
it reliably with subsequent patches applied that open revlogs
in a+ mode and perform both reads and writes.
This patch introduces a proxy class for file handles opened
in r+, w+, and a+ mode on Windows. The class intercepts calls
and audits whether a file positioning function has been called
between read and write operations. If not, a dummy, no-op seek
to the current file position is performed. This appears to be
sufficient to "trick" Windows into allowing transitions between
read and writes without raising errors.
author | Gregory Szorc <gregory.szorc@gmail.com> |
---|---|
date | Sun, 27 Sep 2015 18:46:53 -0700 |
parents | f2719b387380 |
children | 24ea47037186 |
rev | line source |
---|---|
12279 | 1 $ hg init test |
2 $ cd test | |
16350
4f795f5fbb0b
tests: make tests work if directory contains special characters
Thomas Arendsen Hein <thomas@intevation.de>
parents:
14117
diff
changeset
|
3 $ hg unbundle "$TESTDIR/bundles/remote.hg" |
14117
07708f4171f1
tests: create a bundle to bootstrap tests using a remote repository
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents:
12279
diff
changeset
|
4 adding changesets |
07708f4171f1
tests: create a bundle to bootstrap tests using a remote repository
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents:
12279
diff
changeset
|
5 adding manifests |
07708f4171f1
tests: create a bundle to bootstrap tests using a remote repository
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents:
12279
diff
changeset
|
6 adding file changes |
07708f4171f1
tests: create a bundle to bootstrap tests using a remote repository
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents:
12279
diff
changeset
|
7 added 9 changesets with 7 changes to 4 files (+1 heads) |
07708f4171f1
tests: create a bundle to bootstrap tests using a remote repository
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents:
12279
diff
changeset
|
8 (run 'hg heads' to see heads, 'hg merge' to merge) |
07708f4171f1
tests: create a bundle to bootstrap tests using a remote repository
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents:
12279
diff
changeset
|
9 $ hg up tip |
12279 | 10 1 files updated, 0 files merged, 0 files removed, 0 files unresolved |
11 $ cd .. | |
1781
284fc722c342
add an optional argument to push only the specified revisions (push -r)
Benoit Boissinot <benoit.boissinot@ens-lyon.org>
parents:
diff
changeset
|
12 |
12279 | 13 $ for i in 0 1 2 3 4 5 6 7 8; do |
14 > echo | |
15 > mkdir test-"$i" | |
16 > hg --cwd test-"$i" init | |
17 > hg -R test push -r "$i" test-"$i" | |
18 > cd test-"$i" | |
19 > hg verify | |
20 > cd .. | |
21 > done | |
22 | |
23 pushing to test-0 | |
24 searching for changes | |
25 adding changesets | |
26 adding manifests | |
27 adding file changes | |
28 added 1 changesets with 1 changes to 1 files | |
29 checking changesets | |
30 checking manifests | |
31 crosschecking files in changesets and manifests | |
32 checking files | |
33 1 files, 1 changesets, 1 total revisions | |
34 | |
35 pushing to test-1 | |
36 searching for changes | |
37 adding changesets | |
38 adding manifests | |
39 adding file changes | |
40 added 2 changesets with 2 changes to 1 files | |
41 checking changesets | |
42 checking manifests | |
43 crosschecking files in changesets and manifests | |
44 checking files | |
45 1 files, 2 changesets, 2 total revisions | |
46 | |
47 pushing to test-2 | |
48 searching for changes | |
49 adding changesets | |
50 adding manifests | |
51 adding file changes | |
52 added 3 changesets with 3 changes to 1 files | |
53 checking changesets | |
54 checking manifests | |
55 crosschecking files in changesets and manifests | |
56 checking files | |
57 1 files, 3 changesets, 3 total revisions | |
58 | |
59 pushing to test-3 | |
60 searching for changes | |
61 adding changesets | |
62 adding manifests | |
63 adding file changes | |
64 added 4 changesets with 4 changes to 1 files | |
65 checking changesets | |
66 checking manifests | |
67 crosschecking files in changesets and manifests | |
68 checking files | |
69 1 files, 4 changesets, 4 total revisions | |
70 | |
71 pushing to test-4 | |
72 searching for changes | |
73 adding changesets | |
74 adding manifests | |
75 adding file changes | |
76 added 2 changesets with 2 changes to 1 files | |
77 checking changesets | |
78 checking manifests | |
79 crosschecking files in changesets and manifests | |
80 checking files | |
81 1 files, 2 changesets, 2 total revisions | |
82 | |
83 pushing to test-5 | |
84 searching for changes | |
85 adding changesets | |
86 adding manifests | |
87 adding file changes | |
88 added 3 changesets with 3 changes to 1 files | |
89 checking changesets | |
90 checking manifests | |
91 crosschecking files in changesets and manifests | |
92 checking files | |
93 1 files, 3 changesets, 3 total revisions | |
94 | |
95 pushing to test-6 | |
96 searching for changes | |
97 adding changesets | |
98 adding manifests | |
99 adding file changes | |
100 added 4 changesets with 5 changes to 2 files | |
101 checking changesets | |
102 checking manifests | |
103 crosschecking files in changesets and manifests | |
104 checking files | |
105 2 files, 4 changesets, 5 total revisions | |
106 | |
107 pushing to test-7 | |
108 searching for changes | |
109 adding changesets | |
110 adding manifests | |
111 adding file changes | |
112 added 5 changesets with 6 changes to 3 files | |
113 checking changesets | |
114 checking manifests | |
115 crosschecking files in changesets and manifests | |
116 checking files | |
117 3 files, 5 changesets, 6 total revisions | |
118 | |
119 pushing to test-8 | |
120 searching for changes | |
121 adding changesets | |
122 adding manifests | |
123 adding file changes | |
124 added 5 changesets with 5 changes to 2 files | |
125 checking changesets | |
126 checking manifests | |
127 crosschecking files in changesets and manifests | |
128 checking files | |
129 2 files, 5 changesets, 5 total revisions | |
130 | |
131 $ cd test-8 | |
132 | |
133 $ hg pull ../test-7 | |
134 pulling from ../test-7 | |
135 searching for changes | |
136 adding changesets | |
137 adding manifests | |
138 adding file changes | |
139 added 4 changesets with 2 changes to 3 files (+1 heads) | |
140 (run 'hg heads' to see heads, 'hg merge' to merge) | |
141 | |
142 $ hg verify | |
143 checking changesets | |
144 checking manifests | |
145 crosschecking files in changesets and manifests | |
146 checking files | |
147 4 files, 9 changesets, 7 total revisions | |
148 | |
16913
f2719b387380
tests: add missing trailing 'cd ..'
Mads Kiilerich <mads@kiilerich.com>
parents:
16350
diff
changeset
|
149 $ cd .. |