Mercurial > hg
comparison mercurial/branchmap.py @ 51461:47752632b4fc
branchcache: rename `load` to `_load_heads`
We are about to have more similar function, we rename the existing one to a more
meaningful name and mark it private in the process.
author | Pierre-Yves David <pierre-yves.david@octobus.net> |
---|---|
date | Mon, 26 Feb 2024 15:12:20 +0100 |
parents | cebd96dee99a |
children | de1bc7db9f61 |
comparison
equal
deleted
inserted
replaced
51460:cebd96dee99a | 51461:47752632b4fc |
---|---|
487 verify_node=True, | 487 verify_node=True, |
488 ) | 488 ) |
489 if not bcache.validfor(repo): | 489 if not bcache.validfor(repo): |
490 # invalidate the cache | 490 # invalidate the cache |
491 raise ValueError('tip differs') | 491 raise ValueError('tip differs') |
492 bcache.load(repo, lineiter) | 492 bcache._load_heads(repo, lineiter) |
493 except (IOError, OSError): | 493 except (IOError, OSError): |
494 return None | 494 return None |
495 | 495 |
496 except Exception as inst: | 496 except Exception as inst: |
497 if repo.ui.debugflag: | 497 if repo.ui.debugflag: |
509 if f: | 509 if f: |
510 f.close() | 510 f.close() |
511 | 511 |
512 return bcache | 512 return bcache |
513 | 513 |
514 def load(self, repo, lineiter): | 514 def _load_heads(self, repo, lineiter): |
515 """fully loads the branchcache by reading from the file using the line | 515 """fully loads the branchcache by reading from the file using the line |
516 iterator passed""" | 516 iterator passed""" |
517 for line in lineiter: | 517 for line in lineiter: |
518 line = line.rstrip(b'\n') | 518 line = line.rstrip(b'\n') |
519 if not line: | 519 if not line: |