# HG changeset patch # User Pierre-Yves David # Date 1490157405 -3600 # Node ID f80fa478e28928ec39cdd3b06be7b68fb7d9f017 # Parent 393fabaf40397852b269914c54aff133a9f97967 obshashrange: use a small utility function to access the obshash If we want the object to disappear we needs the top level code to stop accessing its attribute. diff -r 393fabaf4039 -r f80fa478e289 hgext3rd/evolve/obsdiscovery.py --- a/hgext3rd/evolve/obsdiscovery.py Wed Mar 22 05:32:25 2017 +0100 +++ b/hgext3rd/evolve/obsdiscovery.py Wed Mar 22 05:36:45 2017 +0100 @@ -306,7 +306,7 @@ sample = [] for entry, remotehash in replies: nbreplies += 1 - if remotehash == entry.obshash: + if remotehash == _obshashrange(local, entry): continue elif 1 == len(entry): missing.add(entry.node) @@ -361,7 +361,7 @@ n = data[:20] index = _unpack('>I', data[20:])[0] r = op.repo.changelog.rev(n) - rhash = stablerange.stablerange(op.repo, r, index).obshash + rhash = _obshashrange(op.repo, stablerange.stablerange(op.repo, r, index)) replies.append(data + rhash) data = inpart.read(24) op.reply.newpart('reply:_donotusemeever_evoext_obshashrange_1', data=iter(replies)) @@ -401,9 +401,13 @@ r.index, len(r), r.depth, - node.short(r.obshash)) + node.short(_obshashrange(repo, r))) ui.status('%3d %s %5d %4d %5d %s\n' % d) +def _obshashrange(repo, rangeid): + """return the obsolete hash associated to a range""" + return rangeid.obshash + @eh.wrapfunction(obsolete.obsstore, '_addmarkers') def _addmarkers(orig, obsstore, *args, **kwargs): obsstore.rangeobshashcache.clear()