# HG changeset patch # User Gregory Szorc # Date 1494097973 25200 # Node ID 75e93d95aae66b02413f5793dada1763c8091408 # Parent 112ba1c7d65d461dab388f8d6f9931e4ce1de134 revlog: rename _chunkraw to _getsegmentforrevs() This completes our rename of internal revlog methods to distinguish between low-level raw revlog data "segments" and higher-level, per-revision "chunks." perf.py has been updated to consult both names so it will work against older Mercurial versions. diff -r 112ba1c7d65d -r 75e93d95aae6 contrib/perf.py --- a/contrib/perf.py Sat May 06 12:02:31 2017 -0700 +++ b/contrib/perf.py Sat May 06 12:12:53 2017 -0700 @@ -887,7 +887,12 @@ see ``perfrevlog`` and ``perfrevlogrevision``. """ rl = cmdutil.openrevlog(repo, 'perfrevlogchunks', file_, opts) - segmentforrevs = rl._chunkraw + + # _chunkraw was renamed to _getsegmentforrevs. + try: + segmentforrevs = rl._getsegmentforrevs + except AttributeError: + segmentforrevs = rl._chunkraw # Verify engines argument. if engines: @@ -1003,7 +1008,13 @@ raise error.CommandError('perfrevlogrevision', 'invalid arguments') r = cmdutil.openrevlog(repo, 'perfrevlogrevision', file_, opts) - segmentforrevs = r._chunkraw + + # _chunkraw was renamed to _getsegmentforrevs. + try: + segmentforrevs = r._getsegmentforrevs + except AttributeError: + segmentforrevs = r._chunkraw + node = r.lookup(rev) rev = r.rev(node) diff -r 112ba1c7d65d -r 75e93d95aae6 mercurial/debugcommands.py --- a/mercurial/debugcommands.py Sat May 06 12:02:31 2017 -0700 +++ b/mercurial/debugcommands.py Sat May 06 12:12:53 2017 -0700 @@ -1707,9 +1707,9 @@ numother += 1 # Obtain data on the raw chunks in the revlog. - chunk = r._chunkraw(rev, rev)[1] - if chunk: - chunktype = chunk[0] + segment = r._getsegmentforrevs(rev, rev)[1] + if segment: + chunktype = segment[0] else: chunktype = 'empty' diff -r 112ba1c7d65d -r 75e93d95aae6 mercurial/revlog.py --- a/mercurial/revlog.py Sat May 06 12:02:31 2017 -0700 +++ b/mercurial/revlog.py Sat May 06 12:12:53 2017 -0700 @@ -1147,7 +1147,7 @@ return self._readsegment(offset, length, df=df) - def _chunkraw(self, startrev, endrev, df=None): + def _getsegmentforrevs(self, startrev, endrev, df=None): """Obtain a segment of raw data corresponding to a range of revisions. Accepts the start and end revisions and an optional already-open @@ -1190,7 +1190,7 @@ Returns a str holding uncompressed data for the requested revision. """ - return self.decompress(self._chunkraw(rev, rev, df=df)[1]) + return self.decompress(self._getsegmentforrevs(rev, rev, df=df)[1]) def _chunks(self, revs, df=None): """Obtain decompressed chunks for the specified revisions. @@ -1217,7 +1217,7 @@ ladd = l.append try: - offset, data = self._chunkraw(revs[0], revs[-1], df=df) + offset, data = self._getsegmentforrevs(revs[0], revs[-1], df=df) except OverflowError: # issue4215 - we can't cache a run of chunks greater than # 2G on Windows @@ -1443,7 +1443,7 @@ df = self.opener(self.datafile, 'w') try: for r in self: - df.write(self._chunkraw(r, r)[1]) + df.write(self._getsegmentforrevs(r, r)[1]) finally: df.close()