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.
--- 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()