Show More
@@ -13,10 +13,10 b' from mercurial import (' | |||||
13 | ) |
|
13 | ) | |
14 |
|
14 | |||
15 | # TESTTMP is optional. This makes it convenient to run without run-tests.py |
|
15 | # TESTTMP is optional. This makes it convenient to run without run-tests.py | |
16 | tvfs = vfs.vfs(encoding.environ.get('TESTTMP', b'/tmp')) |
|
16 | tvfs = vfs.vfs(encoding.environ.get(b'TESTTMP', b'/tmp')) | |
17 |
|
17 | |||
18 | # Enable generaldelta otherwise revlog won't use delta as expected by the test |
|
18 | # Enable generaldelta otherwise revlog won't use delta as expected by the test | |
19 | tvfs.options = {'generaldelta': True, 'revlogv1': True} |
|
19 | tvfs.options = {b'generaldelta': True, b'revlogv1': True} | |
20 |
|
20 | |||
21 | # The test wants to control whether to use delta explicitly, based on |
|
21 | # The test wants to control whether to use delta explicitly, based on | |
22 | # "storedeltachains". |
|
22 | # "storedeltachains". | |
@@ -116,21 +116,21 b" def addgroupcopy(rlog, tr, destname=b'_d" | |||||
116 | deltaparent = min(0, parentrev) |
|
116 | deltaparent = min(0, parentrev) | |
117 | if not rlog.candelta(deltaparent, r): |
|
117 | if not rlog.candelta(deltaparent, r): | |
118 | deltaparent = -1 |
|
118 | deltaparent = -1 | |
119 | return {'node': rlog.node(r), 'p1': pnode, 'p2': node.nullid, |
|
119 | return {b'node': rlog.node(r), b'p1': pnode, b'p2': node.nullid, | |
120 | 'cs': rlog.node(rlog.linkrev(r)), 'flags': rlog.flags(r), |
|
120 | b'cs': rlog.node(rlog.linkrev(r)), b'flags': rlog.flags(r), | |
121 | 'deltabase': rlog.node(deltaparent), |
|
121 | b'deltabase': rlog.node(deltaparent), | |
122 | 'delta': rlog.revdiff(deltaparent, r)} |
|
122 | b'delta': rlog.revdiff(deltaparent, r)} | |
123 |
|
123 | |||
124 | def deltaiter(self): |
|
124 | def deltaiter(self): | |
125 | chain = None |
|
125 | chain = None | |
126 | for chunkdata in iter(lambda: self.deltachunk(chain), {}): |
|
126 | for chunkdata in iter(lambda: self.deltachunk(chain), {}): | |
127 | node = chunkdata['node'] |
|
127 | node = chunkdata[b'node'] | |
128 | p1 = chunkdata['p1'] |
|
128 | p1 = chunkdata[b'p1'] | |
129 | p2 = chunkdata['p2'] |
|
129 | p2 = chunkdata[b'p2'] | |
130 | cs = chunkdata['cs'] |
|
130 | cs = chunkdata[b'cs'] | |
131 | deltabase = chunkdata['deltabase'] |
|
131 | deltabase = chunkdata[b'deltabase'] | |
132 | delta = chunkdata['delta'] |
|
132 | delta = chunkdata[b'delta'] | |
133 | flags = chunkdata['flags'] |
|
133 | flags = chunkdata[b'flags'] | |
134 |
|
134 | |||
135 | chain = node |
|
135 | chain = node | |
136 |
|
136 | |||
@@ -166,9 +166,9 b" def lowlevelcopy(rlog, tr, destname=b'_d" | |||||
166 | flags = rlog.flags(r) |
|
166 | flags = rlog.flags(r) | |
167 | ifh = dfh = None |
|
167 | ifh = dfh = None | |
168 | try: |
|
168 | try: | |
169 | ifh = dlog.opener(dlog.indexfile, 'a+') |
|
169 | ifh = dlog.opener(dlog.indexfile, b'a+') | |
170 | if not dlog._inline: |
|
170 | if not dlog._inline: | |
171 | dfh = dlog.opener(dlog.datafile, 'a+') |
|
171 | dfh = dlog.opener(dlog.datafile, b'a+') | |
172 | dlog._addrevision(rlog.node(r), text, tr, r, p1, p2, flags, |
|
172 | dlog._addrevision(rlog.node(r), text, tr, r, p1, p2, flags, | |
173 | cachedelta, ifh, dfh) |
|
173 | cachedelta, ifh, dfh) | |
174 | finally: |
|
174 | finally: | |
@@ -305,7 +305,7 b' def maintest():' | |||||
305 | checkrevlog(rl2, expected) |
|
305 | checkrevlog(rl2, expected) | |
306 | print('addgroupcopy test passed') |
|
306 | print('addgroupcopy test passed') | |
307 | # Copy via revlog.clone |
|
307 | # Copy via revlog.clone | |
308 | rl3 = newrevlog(name='_destrevlog3.i', recreate=True) |
|
308 | rl3 = newrevlog(name=b'_destrevlog3.i', recreate=True) | |
309 | rl.clone(tr, rl3) |
|
309 | rl.clone(tr, rl3) | |
310 | checkrevlog(rl3, expected) |
|
310 | checkrevlog(rl3, expected) | |
311 | print('clone test passed') |
|
311 | print('clone test passed') |
General Comments 0
You need to be logged in to leave comments.
Login now