# HG changeset patch # User Pierre-Yves David # Date 1496140334 -7200 # Node ID b99b83728ea38254413bc259beb93cb3ed28e48a # Parent 6da129b2b4400d7646fc8c3c3e873825dd862504 obsdiscovery: extract '_canobshashtree' having this as a simple function will help use to generalise the obsdiscovery algorithm we use. diff -r 6da129b2b440 -r b99b83728ea3 hgext3rd/evolve/obsdiscovery.py --- 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 = []