Patchwork D10512: bzr: only support bzr conversion on Python3

login
register
mail settings
Submitter phabricator
Date April 28, 2021, 3:08 p.m.
Message ID <differential-rev-PHID-DREV-qhx6oojqagtfpgxnomxn-req@mercurial-scm.org>
Download mbox | patch
Permalink /patch/48830/
State New
Headers show

Comments

phabricator - April 28, 2021, 3:08 p.m.
Alphare created this revision.
Herald added a reviewer: hg-reviewers.
Herald added a subscriber: mercurial-patches.

REVISION SUMMARY
  Python 2 support will be dropped from Mercurial before anyone needs to do a
  bzr -> hg conversion on Python 2 again. Bazaar tests were broken with the new
  lib anyway, which we'll get into in the next patches.

REPOSITORY
  rHG Mercurial

BRANCH
  stable

REVISION DETAIL
  https://phab.mercurial-scm.org/D10512

AFFECTED FILES
  tests/hghave.py

CHANGE DETAILS




To: Alphare, #hg-reviewers
Cc: mercurial-patches, mercurial-devel

Patch

diff --git a/tests/hghave.py b/tests/hghave.py
--- a/tests/hghave.py
+++ b/tests/hghave.py
@@ -29,7 +29,8 @@ 
 stdout = getattr(sys.stdout, 'buffer', sys.stdout)
 stderr = getattr(sys.stderr, 'buffer', sys.stderr)
 
-if sys.version_info[0] >= 3:
+is_not_python2 = sys.version_info[0] >= 3
+if is_not_python2:
 
     def _sys2bytes(p):
         if p is None:
@@ -169,6 +170,8 @@ 
 
 @check("bzr", "Canonical's Bazaar client")
 def has_bzr():
+    if not is_not_python2:
+        return False
     try:
         import bzrlib
         import bzrlib.bzrdir