Mercurial > hg-git
comparison hggit/overlay.py @ 1130:80664524802b
compat: add compatibility for 4.6 mercurial.utils
author | Sean Farley <sean@farley.io> |
---|---|
date | Thu, 24 May 2018 11:26:15 +0200 |
parents | bd1a01f98154 |
children | 9cbf81bb5e27 |
comparison
equal
deleted
inserted
replaced
1129:5edabf9db748 | 1130:80664524802b |
---|---|
12 context, | 12 context, |
13 util, | 13 util, |
14 ) | 14 ) |
15 from mercurial.node import bin, hex, nullid | 15 from mercurial.node import bin, hex, nullid |
16 | 16 |
17 import compat | |
17 | 18 |
18 def _maybehex(n): | 19 def _maybehex(n): |
19 if len(n) == 20: | 20 if len(n) == 20: |
20 return hex(n) | 21 return hex(n) |
21 return n | 22 return n |
205 def data(self): | 206 def data(self): |
206 blob = self._repo.handler.git.get_object(_maybehex(self.fileid)) | 207 blob = self._repo.handler.git.get_object(_maybehex(self.fileid)) |
207 return blob.data | 208 return blob.data |
208 | 209 |
209 def isbinary(self): | 210 def isbinary(self): |
210 return util.binary(self.data()) | 211 return compat.binary(self.data()) |
211 | 212 |
212 | 213 |
213 class overlaychangectx(context.changectx): | 214 class overlaychangectx(context.changectx): |
214 def __init__(self, repo, sha): | 215 def __init__(self, repo, sha): |
215 # Can't store this in self._repo because the base class uses that field | 216 # Can't store this in self._repo because the base class uses that field |