Mercurial > hg
comparison mercurial/utils/storageutil.py @ 42781:aeb2be20b33b
rawdata: update callers in storageutils
We update callers incrementally because this help bisecting failures. This was
useful during development, so we expect it might be useful again in the future.
author | Pierre-Yves David <pierre-yves.david@octobus.net> |
---|---|
date | Wed, 07 Aug 2019 20:11:50 +0200 |
parents | 4fe63b573791 |
children | 268662aac075 |
comparison
equal
deleted
inserted
replaced
42780:7a89b044eea4 | 42781:aeb2be20b33b |
---|---|
302 If not defined, it is assumed that any two revisions can delta with | 302 If not defined, it is assumed that any two revisions can delta with |
303 each other. | 303 each other. |
304 | 304 |
305 ``rawsizefn`` (optional) | 305 ``rawsizefn`` (optional) |
306 Callable receiving a revision number and returning the length of the | 306 Callable receiving a revision number and returning the length of the |
307 ``store.revision(rev, raw=True)``. | 307 ``store.rawdata(rev)``. |
308 | 308 |
309 If not defined, ``len(store.revision(rev, raw=True))`` will be called. | 309 If not defined, ``len(store.rawdata(rev))`` will be called. |
310 | 310 |
311 ``revdifffn`` (optional) | 311 ``revdifffn`` (optional) |
312 Callable receiving a pair of revision numbers that returns a delta | 312 Callable receiving a pair of revision numbers that returns a delta |
313 between them. | 313 between them. |
314 | 314 |
420 baserevisionsize = None | 420 baserevisionsize = None |
421 | 421 |
422 if revisiondata: | 422 if revisiondata: |
423 if store.iscensored(baserev) or store.iscensored(rev): | 423 if store.iscensored(baserev) or store.iscensored(rev): |
424 try: | 424 try: |
425 revision = store.revision(node, raw=True) | 425 revision = store.rawdata(node) |
426 except error.CensoredNodeError as e: | 426 except error.CensoredNodeError as e: |
427 revision = e.tombstone | 427 revision = e.tombstone |
428 | 428 |
429 if baserev != nullrev: | 429 if baserev != nullrev: |
430 if rawsizefn: | 430 if rawsizefn: |
431 baserevisionsize = rawsizefn(baserev) | 431 baserevisionsize = rawsizefn(baserev) |
432 else: | 432 else: |
433 baserevisionsize = len(store.revision(baserev, | 433 baserevisionsize = len(store.rawdata(baserev)) |
434 raw=True)) | |
435 | 434 |
436 elif (baserev == nullrev | 435 elif (baserev == nullrev |
437 and deltamode != repository.CG_DELTAMODE_PREV): | 436 and deltamode != repository.CG_DELTAMODE_PREV): |
438 revision = store.revision(node, raw=True) | 437 revision = store.rawdata(node) |
439 available.add(rev) | 438 available.add(rev) |
440 else: | 439 else: |
441 if revdifffn: | 440 if revdifffn: |
442 delta = revdifffn(baserev, rev) | 441 delta = revdifffn(baserev, rev) |
443 else: | 442 else: |
444 delta = mdiff.textdiff(store.revision(baserev, raw=True), | 443 delta = mdiff.textdiff(store.rawdata(baserev), |
445 store.revision(rev, raw=True)) | 444 store.rawdata(rev)) |
446 | 445 |
447 available.add(rev) | 446 available.add(rev) |
448 | 447 |
449 yield resultcls( | 448 yield resultcls( |
450 node=node, | 449 node=node, |