# HG changeset patch # User Pierre-Yves David # Date 1524582822 -3600 # Node ID d7a89d5b36846c02b9f9a3579e796110187ecd2c # Parent 95ee7bf46adea98d1303cdccec8329d1d525d285 wirepeer: try modern module first This avoid some issue with remaining .pyc diff -r 95ee7bf46ade -r d7a89d5b3684 hgext3rd/evolve/obsdiscovery.py --- a/hgext3rd/evolve/obsdiscovery.py Tue Apr 24 12:07:35 2018 +0100 +++ b/hgext3rd/evolve/obsdiscovery.py Tue Apr 24 16:13:42 2018 +0100 @@ -51,14 +51,14 @@ stablerangecache, ) -try: # < hg-4.6 +try: + from mercurial import wireprototypes, wireprotov1server + from mercurial.wireprotov1peer import wirepeer + from mercurial.wireprototypes import encodelist, decodelist +except (ImportError, AttributeError): # <= hg-4.5 from mercurial import wireproto as wireprototypes wireprotov1server = wireprototypes from mercurial.wireproto import wirepeer, encodelist, decodelist -except (ImportError, AttributeError): - from mercurial import wireprototypes, wireprotov1server - from mercurial.wireprotov1peer import wirepeer - from mercurial.wireprototypes import encodelist, decodelist _pack = struct.pack _unpack = struct.unpack diff -r 95ee7bf46ade -r d7a89d5b3684 hgext3rd/evolve/obsexchange.py --- a/hgext3rd/evolve/obsexchange.py Tue Apr 24 12:07:35 2018 +0100 +++ b/hgext3rd/evolve/obsexchange.py Tue Apr 24 16:13:42 2018 +0100 @@ -54,12 +54,12 @@ @eh.uisetup def addgetbundleargs(self): try: - from mercurial import wireprototypes - gboptsmap = wireprototypes.GETBUNDLE_ARGUMENTS - except (ImportError, AttributeError): # <= hg 4.5 from mercurial import wireproto gboptsmap = wireproto.gboptsmap + except (ImportError, AttributeError): + from mercurial import wireprototypes + gboptsmap = wireprototypes.GETBUNDLE_ARGUMENTS gboptsmap['evo_obscommon'] = 'nodes' gboptsmap['evo_missing_nodes'] = 'nodes'