MCPcopy Index your code
hub / github.com/ether/etherpad / getInternalRevisionAText

Method getInternalRevisionAText

src/node/db/Pad.ts:399–412  ·  view source on GitHub ↗
(targetRev: number)

Source from the content-addressed store, hash-verified

397 }
398
399 async getInternalRevisionAText(targetRev: number) {
400 const keyRev = this.getKeyRevisionNumber(targetRev);
401 const headRev = this.getHeadRevisionNumber();
402 if (targetRev > headRev) targetRev = headRev;
403 const [keyAText, changesets] = await Promise.all([
404 this._getKeyRevisionAText(keyRev),
405 Promise.all(
406 Stream.range(keyRev + 1, targetRev + 1).map(this.getRevisionChangeset.bind(this))),
407 ]);
408 const apool = this.apool();
409 let atext = keyAText as AText;
410 for (const cs of changesets) atext = applyToAText(cs as string, atext, apool);
411 return atext;
412 }
413
414 async getRevision(revNum: number) {
415 return await this.db.get(`pad:${this.id}:revs:${revNum}`);

Callers 10

restoreRevision.tsFile · 0.80
getPadHTMLFunction · 0.80
ExportEtherpad.tsFile · 0.80
getPadTXTFunction · 0.80
ExportHelper.tsFile · 0.80
API.tsFile · 0.80
getPadLinesFunction · 0.80

Calls 8

getKeyRevisionNumberMethod · 0.95
getHeadRevisionNumberMethod · 0.95
_getKeyRevisionATextMethod · 0.95
apoolMethod · 0.95
applyToATextFunction · 0.90
mapMethod · 0.80
rangeMethod · 0.80
bindMethod · 0.45

Tested by

no test coverage detected