diff --git a/remotefilelog/remotefilelog.py b/remotefilelog/remotefilelog.py --- a/remotefilelog/remotefilelog.py +++ b/remotefilelog/remotefilelog.py @@ -20,8 +20,15 @@ if util.safehasattr(revlog, 'parsemeta'): # Since 0596d274 _parsemeta = revlog.parsemeta + _hash = revlog.hash +elif util.safehasattr(filelog, 'parsemeta'): + _parsemeta = filelog.parsemeta + _hash = revlog.hash else: - _parsemeta = filelog.parsemeta + # since a6c5 + from mercurial.utils import storageutil + _parsemeta = storageutil.parsemeta + _hash = storageutil.hashrevisionsha1 class remotefilelognodemap(object): def __init__(self, filename, store): @@ -63,7 +70,7 @@ # hash with the metadata, like in vanilla filelogs hashtext = shallowutil.createrevlogtext(text, meta.get('copy'), meta.get('copyrev')) - node = revlog.hash(hashtext, p1, p2) + node = _hash(hashtext, p1, p2) return self.addrevision(hashtext, transaction, linknode, p1, p2, node=node) @@ -123,7 +130,7 @@ node=None, flags=revlog.REVIDX_DEFAULT_FLAGS): # text passed to "addrevision" includes hg filelog metadata header if node is None: - node = revlog.hash(text, p1, p2) + node = _hash(text, p1, p2) meta, metaoffset = _parsemeta(text) rawtext, validatehash = self._processflags(text, flags, 'write') diff --git a/remotefilelog/shallowutil.py b/remotefilelog/shallowutil.py --- a/remotefilelog/shallowutil.py +++ b/remotefilelog/shallowutil.py @@ -18,9 +18,14 @@ # Since 0596d274 _parsemeta = revlog.parsemeta _packmeta = revlog.packmeta -else: +elif util.safehasattr(filelog, 'parsemeta'): _parsemeta = filelog.parsemeta _packmeta = filelog.packmeta +else: + # since a6c5 + from mercurial.utils import storageutil + _parsemeta = storageutil.parsemeta + _packmeta = storageutil.packmeta if os.name != 'nt': import grp