Show More
@@ -443,12 +443,13 b' class changelog(revlog.revlog):' | |||
|
443 | 443 | self._filteredrevs = val |
|
444 | 444 | self._filteredrevs_hashcache = {} |
|
445 | 445 | |
|
446 | def _write_docket(self, tr): | |
|
447 | if not self._delayed: | |
|
448 | super(changelog, self)._write_docket(tr) | |
|
449 | ||
|
446 | 450 | def delayupdate(self, tr): |
|
447 | 451 | """delay visibility of index updates to other readers""" |
|
448 |
if self._docket is not |
|
|
449 | return | |
|
450 | ||
|
451 | if not self._delayed: | |
|
452 | if self._docket is None and not self._delayed: | |
|
452 | 453 | if len(self) == 0: |
|
453 | 454 | self._divert = True |
|
454 | 455 | if self._realopener.exists(self._indexfile + b'.a'): |
@@ -468,7 +469,9 b' class changelog(revlog.revlog):' | |||
|
468 | 469 | self._delayed = False |
|
469 | 470 | self.opener = self._realopener |
|
470 | 471 | # move redirected index data back into place |
|
471 |
if self._d |
|
|
472 | if self._docket is not None: | |
|
473 | self._write_docket(tr) | |
|
474 | elif self._divert: | |
|
472 | 475 | assert not self._delaybuf |
|
473 | 476 | tmpname = self._indexfile + b".a" |
|
474 | 477 | nfile = self.opener.open(tmpname) |
@@ -1150,7 +1150,6 b' coreconfigitem(' | |||
|
1150 | 1150 | ) |
|
1151 | 1151 | # "out of experimental" todo list. |
|
1152 | 1152 | # |
|
1153 | # * properly hide uncommitted content to other process | |
|
1154 | 1153 | # * expose transaction content hooks during pre-commit validation |
|
1155 | 1154 | # * include management of a persistent nodemap in the main docket |
|
1156 | 1155 | # * enforce a "no-truncate" policy for mmap safety |
@@ -2096,7 +2096,7 b' class revlog(object):' | |||
|
2096 | 2096 | try: |
|
2097 | 2097 | yield |
|
2098 | 2098 | if self._docket is not None: |
|
2099 |
self._docket |
|
|
2099 | self._write_docket(transaction) | |
|
2100 | 2100 | finally: |
|
2101 | 2101 | self._writinghandles = None |
|
2102 | 2102 | finally: |
@@ -2105,6 +2105,15 b' class revlog(object):' | |||
|
2105 | 2105 | if dfh is not None: |
|
2106 | 2106 | dfh.close() |
|
2107 | 2107 | |
|
2108 | def _write_docket(self, transaction): | |
|
2109 | """write the current docket on disk | |
|
2110 | ||
|
2111 | Exist as a method to help changelog to implement transaction logic | |
|
2112 | ||
|
2113 | We could also imagine using the same transaction logic for all revlog | |
|
2114 | since docket are cheap.""" | |
|
2115 | self._docket.write(transaction) | |
|
2116 | ||
|
2108 | 2117 | def addrevision( |
|
2109 | 2118 | self, |
|
2110 | 2119 | text, |
@@ -3187,18 +3196,6 b' class revlog(object):' | |||
|
3187 | 3196 | # Nothing to generate or remove |
|
3188 | 3197 | return |
|
3189 | 3198 | |
|
3190 | # changelog implement some "delayed" writing mechanism that assume that | |
|
3191 | # all index data is writen in append mode and is therefor incompatible | |
|
3192 | # with the seeked write done in this method. The use of such "delayed" | |
|
3193 | # writing will soon be removed for revlog version that support side | |
|
3194 | # data, so for now, we only keep this simple assert to highlight the | |
|
3195 | # situation. | |
|
3196 | delayed = getattr(self, '_delayed', False) | |
|
3197 | diverted = getattr(self, '_divert', False) | |
|
3198 | if delayed and not diverted: | |
|
3199 | msg = "cannot rewrite_sidedata of a delayed revlog" | |
|
3200 | raise error.ProgrammingError(msg) | |
|
3201 | ||
|
3202 | 3199 | new_entries = [] |
|
3203 | 3200 | # append the new sidedata |
|
3204 | 3201 | with self._writing(transaction): |
@@ -46,13 +46,13 b' synchronisation+output script:' | |||
|
46 | 46 | $ cat << EOF > script/external.sh |
|
47 | 47 | > #!/bin/sh |
|
48 | 48 | > $RUNTESTDIR/testlib/wait-on-file 5 $HG_TEST_FILE_EXT_UNLOCK $HG_TEST_FILE_EXT_WAITING |
|
49 | > hg log --rev 'tip' -T 'external: {rev} {desc}\n' > $TESTTMP/output/external.out | |
|
49 | > hg log --rev 'tip' -T 'external: {rev} {desc}\n' > $TESTTMP/output/external.out 2>/dev/null | |
|
50 | 50 | > touch $HG_TEST_FILE_EXT_DONE |
|
51 | 51 | > EOF |
|
52 | 52 | $ chmod +x script/external.sh |
|
53 | 53 | $ cat << EOF > script/internal.sh |
|
54 | 54 | > #!/bin/sh |
|
55 | > hg log --rev 'tip' -T 'internal: {rev} {desc}\n' > $TESTTMP/output/internal.out | |
|
55 | > hg log --rev 'tip' -T 'internal: {rev} {desc}\n' > $TESTTMP/output/internal.out 2>/dev/null | |
|
56 | 56 | > $RUNTESTDIR/testlib/wait-on-file 5 $HG_TEST_FILE_EXT_DONE $HG_TEST_FILE_EXT_UNLOCK |
|
57 | 57 | > EOF |
|
58 | 58 | $ chmod +x script/internal.sh |
@@ -123,9 +123,9 b' the repository should still be inline (f' | |||
|
123 | 123 | |
|
124 | 124 | $ make_one_commit first |
|
125 | 125 | pre-commit: -1 |
|
126 |
external: -1 |
|
|
127 |
|
|
|
128 | internal: 0 first | |
|
126 | external: -1 | |
|
127 | internal: 0 first (revlogv1 !) | |
|
128 | internal: -1 (revlogv2 known-bad-output !) | |
|
129 | 129 | post-tr: 0 first |
|
130 | 130 | |
|
131 | 131 | #if revlogv1 |
@@ -149,9 +149,9 b' the repository should still be inline (f' | |||
|
149 | 149 | |
|
150 | 150 | $ make_one_commit second |
|
151 | 151 | pre-commit: 0 first |
|
152 |
external: 0 first |
|
|
153 |
|
|
|
154 | internal: 1 second | |
|
152 | external: 0 first | |
|
153 | internal: 1 second (revlogv1 !) | |
|
154 | internal: 0 first (revlogv2 known-bad-output !) | |
|
155 | 155 | post-tr: 1 second |
|
156 | 156 | |
|
157 | 157 | #if revlogv1 |
@@ -176,9 +176,9 b' the repository should still be inline (f' | |||
|
176 | 176 | $ make_one_pull 3 |
|
177 | 177 | pre-commit: 1 second |
|
178 | 178 | warning: repository is unrelated |
|
179 |
external: 1 second |
|
|
180 |
|
|
|
181 | internal: 5 r3 | |
|
179 | external: 1 second | |
|
180 | internal: 5 r3 (revlogv1 !) | |
|
181 | internal: 1 second (revlogv2 known-bad-output !) | |
|
182 | 182 | post-tr: 5 r3 |
|
183 | 183 | |
|
184 | 184 | #if revlogv1 |
@@ -202,9 +202,9 b' the repository should no longer be inlin' | |||
|
202 | 202 | |
|
203 | 203 | $ make_one_pull 400 |
|
204 | 204 | pre-commit: 5 r3 |
|
205 |
external: 5 r3 |
|
|
206 |
|
|
|
207 | internal: 402 r400 | |
|
205 | external: 5 r3 | |
|
206 | internal: 402 r400 (revlogv1 !) | |
|
207 | internal: 5 r3 (revlogv2 known-bad-output !) | |
|
208 | 208 | post-tr: 402 r400 |
|
209 | 209 | |
|
210 | 210 | #if revlogv1 |
@@ -228,9 +228,9 b' the repository should no longer be inlin' | |||
|
228 | 228 | |
|
229 | 229 | $ make_one_commit third |
|
230 | 230 | pre-commit: 402 r400 |
|
231 |
external: 402 r400 |
|
|
232 |
|
|
|
233 | internal: 403 third | |
|
231 | external: 402 r400 | |
|
232 | internal: 403 third (revlogv1 !) | |
|
233 | internal: 402 r400 (revlogv2 known-bad-output !) | |
|
234 | 234 | post-tr: 403 third |
|
235 | 235 | |
|
236 | 236 | #if revlogv1 |
@@ -255,9 +255,9 b' the repository should no longer be inlin' | |||
|
255 | 255 | |
|
256 | 256 | $ make_one_pull tip |
|
257 | 257 | pre-commit: 403 third |
|
258 |
external: 403 third |
|
|
259 |
|
|
|
260 | internal: 503 r500 | |
|
258 | external: 403 third | |
|
259 | internal: 503 r500 (revlogv1 !) | |
|
260 | internal: 403 third (revlogv2 known-bad-output !) | |
|
261 | 261 | post-tr: 503 r500 |
|
262 | 262 | |
|
263 | 263 | #if revlogv1 |
General Comments 0
You need to be logged in to leave comments.
Login now