Mercurial > hg
comparison mercurial/changelog.py @ 46631:230f73019e49
changelog: rename parameters to reflect semantics
`read` and `readfiles` can be used with a revision just as well, so
follow the naming convention in revlog to reflect this.
Differential Revision: https://phab.mercurial-scm.org/D10081
author | Joerg Sonnenberger <joerg@bec.de> |
---|---|
date | Mon, 01 Mar 2021 16:54:51 +0100 |
parents | e9901d01d135 |
children | f63299ee7e4d |
comparison
equal
deleted
inserted
replaced
46630:842f2372ced6 | 46631:230f73019e49 |
---|---|
505 | 505 |
506 def _enforceinlinesize(self, tr, fp=None): | 506 def _enforceinlinesize(self, tr, fp=None): |
507 if not self._delayed: | 507 if not self._delayed: |
508 revlog.revlog._enforceinlinesize(self, tr, fp) | 508 revlog.revlog._enforceinlinesize(self, tr, fp) |
509 | 509 |
510 def read(self, node): | 510 def read(self, nodeorrev): |
511 """Obtain data from a parsed changelog revision. | 511 """Obtain data from a parsed changelog revision. |
512 | 512 |
513 Returns a 6-tuple of: | 513 Returns a 6-tuple of: |
514 | 514 |
515 - manifest node in binary | 515 - manifest node in binary |
521 | 521 |
522 Unless you need to access all fields, consider calling | 522 Unless you need to access all fields, consider calling |
523 ``changelogrevision`` instead, as it is faster for partial object | 523 ``changelogrevision`` instead, as it is faster for partial object |
524 access. | 524 access. |
525 """ | 525 """ |
526 d, s = self._revisiondata(node) | 526 d, s = self._revisiondata(nodeorrev) |
527 c = changelogrevision( | 527 c = changelogrevision( |
528 d, s, self._copiesstorage == b'changeset-sidedata' | 528 d, s, self._copiesstorage == b'changeset-sidedata' |
529 ) | 529 ) |
530 return (c.manifest, c.user, c.date, c.files, c.description, c.extra) | 530 return (c.manifest, c.user, c.date, c.files, c.description, c.extra) |
531 | 531 |
534 text, sidedata = self._revisiondata(nodeorrev) | 534 text, sidedata = self._revisiondata(nodeorrev) |
535 return changelogrevision( | 535 return changelogrevision( |
536 text, sidedata, self._copiesstorage == b'changeset-sidedata' | 536 text, sidedata, self._copiesstorage == b'changeset-sidedata' |
537 ) | 537 ) |
538 | 538 |
539 def readfiles(self, node): | 539 def readfiles(self, nodeorrev): |
540 """ | 540 """ |
541 short version of read that only returns the files modified by the cset | 541 short version of read that only returns the files modified by the cset |
542 """ | 542 """ |
543 text = self.revision(node) | 543 text = self.revision(nodeorrev) |
544 if not text: | 544 if not text: |
545 return [] | 545 return [] |
546 last = text.index(b"\n\n") | 546 last = text.index(b"\n\n") |
547 l = text[:last].split(b'\n') | 547 l = text[:last].split(b'\n') |
548 return l[3:] | 548 return l[3:] |