Details
Details
Diff Detail
Diff Detail
- Repository
- rHG Mercurial
- Lint
Lint Skipped - Unit
Unit Tests Skipped
( )
Lint Skipped |
Unit Tests Skipped |
Path | Packages | |||
---|---|---|---|---|
M | mercurial/bundlerepo.py (4 lines) |
Status | Author | Revision | |
---|---|---|---|
Accepted | indygreg | ||
Accepted | indygreg | ||
Accepted | indygreg | ||
Accepted | indygreg | ||
Accepted | indygreg | ||
Accepted | indygreg | ||
Accepted | indygreg | ||
Accepted | indygreg | ||
Accepted | indygreg | ||
Accepted | indygreg | ||
Needs Revision | indygreg | ||
Needs Revision | indygreg | ||
Needs Revision | indygreg | ||
Accepted | indygreg | ||
Needs Revision | indygreg | ||
Closed | indygreg |
return revlog.revlog._chunk(self, rev) | return revlog.revlog._chunk(self, rev) | ||||
self.bundle.seek(self.start(rev)) | self.bundle.seek(self.start(rev)) | ||||
return self.bundle.read(self.length(rev)) | return self.bundle.read(self.length(rev)) | ||||
def revdiff(self, rev1, rev2): | def revdiff(self, rev1, rev2): | ||||
"""return or calculate a delta between two revisions""" | """return or calculate a delta between two revisions""" | ||||
if rev1 > self.repotiprev and rev2 > self.repotiprev: | if rev1 > self.repotiprev and rev2 > self.repotiprev: | ||||
# hot path for bundle | # hot path for bundle | ||||
revb = self.index[rev2][3] | revb = self.index[rev2].baserev | ||||
if revb == rev1: | if revb == rev1: | ||||
return self._chunk(rev2) | return self._chunk(rev2) | ||||
elif rev1 <= self.repotiprev and rev2 <= self.repotiprev: | elif rev1 <= self.repotiprev and rev2 <= self.repotiprev: | ||||
return revlog.revlog.revdiff(self, rev1, rev2) | return revlog.revlog.revdiff(self, rev1, rev2) | ||||
return mdiff.textdiff(self.revision(rev1, raw=True), | return mdiff.textdiff(self.revision(rev1, raw=True), | ||||
self.revision(rev2, raw=True)) | self.revision(rev2, raw=True)) | ||||
chain = [] | chain = [] | ||||
iterrev = rev | iterrev = rev | ||||
# reconstruct the revision if it is from a changegroup | # reconstruct the revision if it is from a changegroup | ||||
while iterrev > self.repotiprev: | while iterrev > self.repotiprev: | ||||
if self._cache and self._cache[1] == iterrev: | if self._cache and self._cache[1] == iterrev: | ||||
rawtext = self._cache[2] | rawtext = self._cache[2] | ||||
break | break | ||||
chain.append(iterrev) | chain.append(iterrev) | ||||
iterrev = self.index[iterrev][3] | iterrev = self.index[iterrev].baserev | ||||
if rawtext is None: | if rawtext is None: | ||||
rawtext = self.baserevision(iterrev) | rawtext = self.baserevision(iterrev) | ||||
while chain: | while chain: | ||||
delta = self._chunk(chain.pop()) | delta = self._chunk(chain.pop()) | ||||
rawtext = mdiff.patches(rawtext, [delta]) | rawtext = mdiff.patches(rawtext, [delta]) | ||||
text, validatehash = self._processflags(rawtext, self.flags(rev), | text, validatehash = self._processflags(rawtext, self.flags(rev), |