obsdiscovery: extract '_canobshashtree'
having this as a simple function will help use to generalise the obsdiscovery
algorithm we use.
--- a/hgext3rd/evolve/obsdiscovery.py Tue May 30 12:26:57 2017 +0200
+++ b/hgext3rd/evolve/obsdiscovery.py Tue May 30 12:32:14 2017 +0200
@@ -703,6 +703,9 @@
# the obshash of its parents. This is similar to what happend for changeset
# node where the parent is used in the computation
+def _canobshashtree(repo, remote):
+ return remote.capable('_evoext_obshash_0')
+
@eh.command(
'debugobsrelsethashtree',
[('', 'v0', None, 'hash on marker format "0"'),
@@ -855,7 +858,7 @@
revs = list(repo.revs('::%ln', pushop.futureheads))
unfi = repo.unfiltered()
cl = unfi.changelog
- if not pushop.remote.capable('_evoext_obshash_0'):
+ if not _canobshashtree(repo, pushop.remote):
return orig(pushop)
common = []