Show More
@@ -17,7 +17,10 b' import os' | |||||
17 | import shutil |
|
17 | import shutil | |
18 |
|
18 | |||
19 | from .i18n import _ |
|
19 | from .i18n import _ | |
20 |
from .node import |
|
20 | from .node import ( | |
|
21 | nullid, | |||
|
22 | nullrev | |||
|
23 | ) | |||
21 |
|
24 | |||
22 | from . import ( |
|
25 | from . import ( | |
23 | bundle2, |
|
26 | bundle2, | |
@@ -108,20 +111,10 b' class bundlerevlog(revlog.revlog):' | |||||
108 | return mdiff.textdiff(self.rawdata(rev1), |
|
111 | return mdiff.textdiff(self.rawdata(rev1), | |
109 | self.rawdata(rev2)) |
|
112 | self.rawdata(rev2)) | |
110 |
|
113 | |||
111 |
def |
|
114 | def _rawtext(self, node, rev, _df=None): | |
112 | """return an uncompressed revision of a given node or revision |
|
115 | if rev is None: | |
113 | number. |
|
|||
114 | """ |
|
|||
115 | if isinstance(nodeorrev, int): |
|
|||
116 | rev = nodeorrev |
|
|||
117 | node = self.node(rev) |
|
|||
118 | else: |
|
|||
119 | node = nodeorrev |
|
|||
120 | rev = self.rev(node) |
|
116 | rev = self.rev(node) | |
121 |
|
117 | validated = False | ||
122 | if node == nullid: |
|
|||
123 | return "" |
|
|||
124 |
|
||||
125 | rawtext = None |
|
118 | rawtext = None | |
126 | chain = [] |
|
119 | chain = [] | |
127 | iterrev = rev |
|
120 | iterrev = rev | |
@@ -132,19 +125,19 b' class bundlerevlog(revlog.revlog):' | |||||
132 | break |
|
125 | break | |
133 | chain.append(iterrev) |
|
126 | chain.append(iterrev) | |
134 | iterrev = self.index[iterrev][3] |
|
127 | iterrev = self.index[iterrev][3] | |
135 |
if |
|
128 | if iterrev == nullrev: | |
136 |
rawtext = |
|
129 | rawtext = '' | |
137 |
|
130 | elif rawtext is None: | ||
|
131 | r = super(bundlerevlog, self)._rawtext(self.node(iterrev), | |||
|
132 | iterrev, | |||
|
133 | _df=_df) | |||
|
134 | __, rawtext, validated = r | |||
|
135 | if chain: | |||
|
136 | validated = False | |||
138 | while chain: |
|
137 | while chain: | |
139 | delta = self._chunk(chain.pop()) |
|
138 | delta = self._chunk(chain.pop()) | |
140 | rawtext = mdiff.patches(rawtext, [delta]) |
|
139 | rawtext = mdiff.patches(rawtext, [delta]) | |
141 |
|
140 | return rev, rawtext, validated | ||
142 | text, validatehash = self._processflags(rawtext, self.flags(rev), |
|
|||
143 | 'read', raw=raw) |
|
|||
144 | if validatehash: |
|
|||
145 | self.checkhash(text, node, rev=rev) |
|
|||
146 | self._revisioncache = (node, rev, rawtext) |
|
|||
147 | return text |
|
|||
148 |
|
141 | |||
149 | def rawdata(self, nodeorrev, _df=None): |
|
142 | def rawdata(self, nodeorrev, _df=None): | |
150 | return self.revision(nodeorrev, _df=_df, raw=True) |
|
143 | return self.revision(nodeorrev, _df=_df, raw=True) |
General Comments 0
You need to be logged in to leave comments.
Login now