diff --git a/mercurial/revlog.py b/mercurial/revlog.py --- a/mercurial/revlog.py +++ b/mercurial/revlog.py @@ -2192,19 +2192,8 @@ class revlog(object): if nodesorder is None and not self._generaldelta: nodesorder = 'storage' - frev = self.rev - - if nodesorder == 'nodes': - revs = [frev(n) for n in nodes] - elif nodesorder == 'storage': - revs = sorted(frev(n) for n in nodes) - else: - assert self._generaldelta - revs = set(frev(n) for n in nodes) - revs = dagop.linearize(revs, self.parentrevs) - return storageutil.emitrevisions( - self, revs, revlogrevisiondelta, + self, nodes, nodesorder, revlogrevisiondelta, deltaparentfn=self.deltaparent, candeltafn=self.candelta, rawsizefn=self.rawsize, diff --git a/mercurial/utils/storageutil.py b/mercurial/utils/storageutil.py --- a/mercurial/utils/storageutil.py +++ b/mercurial/utils/storageutil.py @@ -17,6 +17,7 @@ from ..node import ( nullrev, ) from .. import ( + dagop, error, mdiff, pycompat, @@ -264,8 +265,8 @@ def resolvestripinfo(minlinkrev, tiprev, return strippoint, brokenrevs -def emitrevisions(store, revs, resultcls, deltaparentfn=None, candeltafn=None, - rawsizefn=None, revdifffn=None, flagsfn=None, +def emitrevisions(store, nodes, nodesorder, resultcls, deltaparentfn=None, + candeltafn=None, rawsizefn=None, revdifffn=None, flagsfn=None, sendfulltext=False, revisiondata=False, assumehaveparentrevisions=False, deltaprevious=False): @@ -277,8 +278,8 @@ def emitrevisions(store, revs, resultcls ``store`` Object conforming to ``ifilestorage`` interface. - ``revs`` - List of integer revision numbers whose data to emit. + ``nodes`` + List of revision nodes whose data to emit. ``resultcls`` A type implementing the ``irevisiondelta`` interface that will be @@ -322,6 +323,7 @@ def emitrevisions(store, revs, resultcls ``sendfulltext`` Whether to send fulltext revisions instead of deltas, if allowed. + ``nodesorder`` ``revisiondata`` ``assumehaveparentrevisions`` ``deltaprevious`` @@ -329,6 +331,15 @@ def emitrevisions(store, revs, resultcls """ fnode = store.node + frev = store.rev + + if nodesorder == 'nodes': + revs = [frev(n) for n in nodes] + elif nodesorder == 'storage': + revs = sorted(frev(n) for n in nodes) + else: + revs = set(frev(n) for n in nodes) + revs = dagop.linearize(revs, store.parentrevs) prevrev = None