mirror of
https://github.com/facebook/sapling.git
synced 2024-12-26 22:47:26 +03:00
py3: make .py tests continue to run on python 2
Summary: Use sed to convert testutil.ddot requires to hghave. ignore-conflict-markers for test-simplemerge.py Reviewed By: simpkins Differential Revision: D19658355 fbshipit-source-id: afae73eb1e43ead79514dfaf9f911f51ac25972e
This commit is contained in:
parent
4e10dbb9f6
commit
5232dcf9d1
@ -10,10 +10,10 @@ import time
|
||||
|
||||
from edenscm.mercurial import ancestor, debugcommands, hg, pycompat, ui as uimod, util
|
||||
from edenscm.mercurial.node import nullrev
|
||||
from testutil.dott import feature
|
||||
from hghave import require
|
||||
|
||||
|
||||
feature.require(["py2"])
|
||||
require(["py2"])
|
||||
|
||||
if sys.version_info[0] >= 3:
|
||||
long = int
|
||||
|
@ -4,10 +4,10 @@ import unittest
|
||||
|
||||
from edenscm.mercurial import mdiff
|
||||
from edenscm.mercurial.context import _annotatepair, annotateline
|
||||
from testutil.dott import feature
|
||||
from hghave import require
|
||||
|
||||
|
||||
feature.require(["py2"])
|
||||
require(["py2"])
|
||||
|
||||
try:
|
||||
xrange(0)
|
||||
|
@ -9,11 +9,11 @@ from __future__ import absolute_import
|
||||
import os
|
||||
import sys
|
||||
|
||||
from hghave import require
|
||||
from testutil import argspans
|
||||
from testutil.dott import feature
|
||||
|
||||
|
||||
feature.require(["py2"])
|
||||
require(["py2"])
|
||||
|
||||
|
||||
try:
|
||||
|
@ -7,10 +7,10 @@ import tempfile
|
||||
import unittest
|
||||
|
||||
from edenscm.mercurial import util
|
||||
from testutil.dott import feature
|
||||
from hghave import require
|
||||
|
||||
|
||||
feature.require(["py2"])
|
||||
require(["py2"])
|
||||
|
||||
|
||||
atomictempfile = util.atomictempfile
|
||||
|
@ -8,10 +8,10 @@
|
||||
from __future__ import absolute_import, print_function
|
||||
|
||||
from edenscm.mercurial import error, peer, util, wireproto
|
||||
from testutil.dott import feature
|
||||
from hghave import require
|
||||
|
||||
|
||||
feature.require(["py2"])
|
||||
require(["py2"])
|
||||
|
||||
|
||||
# equivalent of repo.repository
|
||||
|
@ -5,10 +5,10 @@ import struct
|
||||
import unittest
|
||||
|
||||
from edenscm.mercurial import mdiff
|
||||
from testutil.dott import feature
|
||||
from hghave import require
|
||||
|
||||
|
||||
feature.require(["py2"])
|
||||
require(["py2"])
|
||||
|
||||
|
||||
class diffreplace(collections.namedtuple("diffreplace", "start end from_ to")):
|
||||
|
@ -9,10 +9,10 @@ import unittest
|
||||
import silenttestrunner
|
||||
from bindings import bookmarkstore
|
||||
from edenscm.mercurial import node
|
||||
from testutil.dott import feature
|
||||
from hghave import require
|
||||
|
||||
|
||||
feature.require(["py2"])
|
||||
require(["py2"])
|
||||
|
||||
|
||||
class bookmarkstoretests(unittest.TestCase):
|
||||
|
@ -3,10 +3,10 @@
|
||||
from __future__ import absolute_import, print_function
|
||||
|
||||
from edenscm.mercurial import bundlerepo, httppeer, localrepo, sshpeer, ui as uimod
|
||||
from testutil.dott import feature
|
||||
from hghave import require
|
||||
|
||||
|
||||
feature.require(["py2"])
|
||||
require(["py2"])
|
||||
|
||||
|
||||
def checkobject(o):
|
||||
|
@ -6,10 +6,10 @@
|
||||
import os
|
||||
import re
|
||||
|
||||
from testutil.dott import feature
|
||||
from hghave import require
|
||||
|
||||
|
||||
feature.require(["py2"])
|
||||
require(["py2"])
|
||||
|
||||
|
||||
def checkpath(path, dllnames):
|
||||
|
@ -4,10 +4,10 @@ import os
|
||||
|
||||
from edenscm.mercurial import context, encoding, hg, scmutil, ui as uimod
|
||||
from edenscm.mercurial.node import hex
|
||||
from testutil.dott import feature
|
||||
from hghave import require
|
||||
|
||||
|
||||
feature.require(["py2"])
|
||||
require(["py2"])
|
||||
|
||||
|
||||
u = uimod.ui.load()
|
||||
|
@ -9,9 +9,9 @@ demandimport.enable()
|
||||
import os
|
||||
import subprocess
|
||||
import sys
|
||||
from testutil.dott import feature
|
||||
from hghave import require
|
||||
|
||||
feature.require(["py2"])
|
||||
require(["py2"])
|
||||
|
||||
# Only run if demandimport is allowed
|
||||
if subprocess.call(["python", "%s/hghave" % os.environ["TESTDIR"], "demandimport"]):
|
||||
|
@ -3,10 +3,10 @@ from __future__ import absolute_import, print_function
|
||||
import os
|
||||
|
||||
from edenscm.mercurial import dispatch
|
||||
from testutil.dott import feature
|
||||
from hghave import require
|
||||
|
||||
|
||||
feature.require(["py2"])
|
||||
require(["py2"])
|
||||
|
||||
|
||||
def testdispatch(cmd):
|
||||
|
@ -7,10 +7,10 @@ import os
|
||||
import re
|
||||
import sys
|
||||
|
||||
from testutil.dott import feature
|
||||
from hghave import require
|
||||
|
||||
|
||||
feature.require(["py2"])
|
||||
require(["py2"])
|
||||
|
||||
|
||||
ispy3 = sys.version_info[0] >= 3
|
||||
|
@ -3,10 +3,10 @@ from __future__ import absolute_import, print_function
|
||||
import os
|
||||
|
||||
from edenscm.mercurial import commands, extensions, ui as uimod
|
||||
from testutil.dott import feature
|
||||
from hghave import require
|
||||
|
||||
|
||||
feature.require(["py2"])
|
||||
require(["py2"])
|
||||
|
||||
|
||||
ignore = {
|
||||
|
@ -3,10 +3,10 @@ from __future__ import absolute_import
|
||||
import unittest
|
||||
|
||||
from edenscm.mercurial import encoding
|
||||
from testutil.dott import feature
|
||||
from hghave import require
|
||||
|
||||
|
||||
feature.require(["py2"])
|
||||
require(["py2"])
|
||||
|
||||
|
||||
class IsasciistrTest(unittest.TestCase):
|
||||
|
@ -1,10 +1,10 @@
|
||||
from __future__ import absolute_import, print_function
|
||||
|
||||
from edenscm.mercurial import extensions
|
||||
from testutil.dott import feature
|
||||
from hghave import require
|
||||
|
||||
|
||||
feature.require(["py2"])
|
||||
require(["py2"])
|
||||
|
||||
|
||||
def genwrapper(x):
|
||||
|
@ -2,10 +2,10 @@ import os
|
||||
import unittest
|
||||
|
||||
from edenscm.hgext.convert.repo import gitutil, repo
|
||||
from testutil.dott import feature
|
||||
from hghave import require
|
||||
|
||||
|
||||
feature.require(["py2"])
|
||||
require(["py2"])
|
||||
|
||||
|
||||
def draft(test_func):
|
||||
|
@ -3,10 +3,10 @@ from __future__ import absolute_import
|
||||
import itertools
|
||||
|
||||
from edenscm.hgext import absorb
|
||||
from testutil.dott import feature
|
||||
from hghave import require
|
||||
|
||||
|
||||
feature.require(["py2"])
|
||||
require(["py2"])
|
||||
|
||||
|
||||
class simplefctx(object):
|
||||
|
@ -10,10 +10,10 @@ import unittest
|
||||
import silenttestrunner
|
||||
from edenscm.hgext import extutil
|
||||
from edenscm.mercurial import error, vfs, worker
|
||||
from testutil.dott import feature
|
||||
from hghave import require
|
||||
|
||||
|
||||
feature.require(["py2"])
|
||||
require(["py2"])
|
||||
|
||||
|
||||
locktimeout = 25
|
||||
|
@ -4,10 +4,10 @@ import os
|
||||
import tempfile
|
||||
|
||||
from edenscm.hgext.fastannotate import error, revmap
|
||||
from testutil.dott import feature
|
||||
from hghave import require
|
||||
|
||||
|
||||
feature.require(["py2"])
|
||||
require(["py2"])
|
||||
|
||||
|
||||
try:
|
||||
|
@ -3,10 +3,10 @@ from __future__ import absolute_import
|
||||
import unittest
|
||||
|
||||
import silenttestrunner
|
||||
from testutil.dott import feature
|
||||
from hghave import require
|
||||
|
||||
|
||||
feature.require(["py2"])
|
||||
require(["py2"])
|
||||
|
||||
|
||||
class BisectTests(unittest.TestCase):
|
||||
|
@ -5,10 +5,10 @@ import sys
|
||||
|
||||
from edenscm.hgext import patchrmdir
|
||||
from edenscm.mercurial import util
|
||||
from testutil.dott import feature
|
||||
from hghave import require
|
||||
|
||||
|
||||
feature.require(["py2"])
|
||||
require(["py2"])
|
||||
|
||||
|
||||
if not sys.platform.startswith("linux"):
|
||||
|
@ -18,10 +18,10 @@ from edenscm.hgext.remotefilelog import constants
|
||||
from edenscm.hgext.remotefilelog.datapack import datapackstore
|
||||
from edenscm.mercurial import error
|
||||
from edenscm.mercurial.node import nullid
|
||||
from testutil.dott import feature
|
||||
from hghave import require
|
||||
|
||||
|
||||
feature.require(["py2"])
|
||||
require(["py2"])
|
||||
|
||||
|
||||
SMALLFANOUTCUTOFF = 2 ** 16 / 8
|
||||
|
@ -15,10 +15,10 @@ from bindings import revisionstore
|
||||
from edenscm.hgext.remotefilelog.metadatastore import unionmetadatastore
|
||||
from edenscm.mercurial import error, ui as uimod, util
|
||||
from edenscm.mercurial.node import nullid
|
||||
from testutil.dott import feature
|
||||
from hghave import require
|
||||
|
||||
|
||||
feature.require(["py2"])
|
||||
require(["py2"])
|
||||
|
||||
|
||||
SMALLFANOUTCUTOFF = 2 ** 16 / 8
|
||||
|
@ -7,10 +7,10 @@ import sys
|
||||
# Make sure we use sshaskpass.py in this repo, unaffected by PYTHONPATH
|
||||
from edenscm.hgext import sshaskpass
|
||||
from edenscm.mercurial import error
|
||||
from testutil.dott import feature
|
||||
from hghave import require
|
||||
|
||||
|
||||
feature.require(["py2"])
|
||||
require(["py2"])
|
||||
|
||||
|
||||
if not sys.platform.startswith("linux"):
|
||||
|
@ -12,10 +12,10 @@ from edenscm.mercurial import (
|
||||
util,
|
||||
vfs as vfsmod,
|
||||
)
|
||||
from testutil.dott import feature
|
||||
from hghave import require
|
||||
|
||||
|
||||
feature.require(["py2"])
|
||||
require(["py2"])
|
||||
|
||||
|
||||
try:
|
||||
|
@ -6,10 +6,10 @@ from __future__ import absolute_import, print_function
|
||||
|
||||
from edenscm.mercurial import hg, ui as uimod
|
||||
from edenscm.mercurial.node import hex, nullid
|
||||
from testutil.dott import feature
|
||||
from hghave import require
|
||||
|
||||
|
||||
feature.require(["py2"])
|
||||
require(["py2"])
|
||||
|
||||
|
||||
myui = uimod.ui.load()
|
||||
|
@ -1,10 +1,10 @@
|
||||
from __future__ import absolute_import, print_function
|
||||
|
||||
from edenscm.mercurial import hg
|
||||
from testutil.dott import feature
|
||||
from hghave import require
|
||||
|
||||
|
||||
feature.require(["py2"])
|
||||
require(["py2"])
|
||||
|
||||
|
||||
def testparse(url, branch=[]):
|
||||
|
@ -5,10 +5,10 @@ import sys
|
||||
import tempfile
|
||||
|
||||
from edenscm.mercurial import commands, hg, ui
|
||||
from testutil.dott import feature
|
||||
from hghave import require
|
||||
|
||||
|
||||
feature.require(["py2"])
|
||||
require(["py2"])
|
||||
|
||||
|
||||
try:
|
||||
|
@ -1,10 +1,10 @@
|
||||
from __future__ import absolute_import, print_function
|
||||
|
||||
from edenscm.mercurial import store
|
||||
from testutil.dott import feature
|
||||
from hghave import require
|
||||
|
||||
|
||||
feature.require(["py2"])
|
||||
require(["py2"])
|
||||
|
||||
|
||||
def show(s):
|
||||
|
@ -1,10 +1,10 @@
|
||||
from __future__ import absolute_import, print_function
|
||||
|
||||
from edenscm.hgext.lfs import pointer
|
||||
from testutil.dott import feature
|
||||
from hghave import require
|
||||
|
||||
|
||||
feature.require(["py2"])
|
||||
require(["py2"])
|
||||
|
||||
|
||||
def tryparse(text):
|
||||
|
@ -3,10 +3,10 @@ from __future__ import absolute_import
|
||||
import unittest
|
||||
|
||||
from edenscm.mercurial import error, mdiff
|
||||
from testutil.dott import feature
|
||||
from hghave import require
|
||||
|
||||
|
||||
feature.require(["py2"])
|
||||
require(["py2"])
|
||||
|
||||
|
||||
# for readability, line numbers are 0-origin
|
||||
|
@ -3,10 +3,10 @@ from __future__ import absolute_import, print_function
|
||||
import tempfile
|
||||
|
||||
from edenscm.hgext import linkrevcache
|
||||
from testutil.dott import feature
|
||||
from hghave import require
|
||||
|
||||
|
||||
feature.require(["py2"])
|
||||
require(["py2"])
|
||||
|
||||
|
||||
try:
|
||||
|
@ -17,10 +17,10 @@ from edenscm.mercurial import (
|
||||
util,
|
||||
vfs as vfsmod,
|
||||
)
|
||||
from testutil.dott import feature
|
||||
from hghave import require
|
||||
|
||||
|
||||
feature.require(["py2"])
|
||||
require(["py2"])
|
||||
|
||||
|
||||
testlockname = "testlock"
|
||||
|
@ -1,10 +1,10 @@
|
||||
from __future__ import absolute_import, print_function
|
||||
|
||||
from edenscm.mercurial import util
|
||||
from testutil.dott import feature
|
||||
from hghave import require
|
||||
|
||||
|
||||
feature.require(["py2"])
|
||||
require(["py2"])
|
||||
|
||||
|
||||
def printifpresent(d, xs, name="d"):
|
||||
|
@ -6,10 +6,10 @@ import unittest
|
||||
|
||||
import silenttestrunner
|
||||
from edenscm.mercurial import manifest as manifestmod, match as matchmod
|
||||
from testutil.dott import feature
|
||||
from hghave import require
|
||||
|
||||
|
||||
feature.require(["py2"])
|
||||
require(["py2"])
|
||||
|
||||
|
||||
EMTPY_MANIFEST = b""
|
||||
|
@ -4,10 +4,10 @@ import unittest
|
||||
|
||||
import silenttestrunner
|
||||
from edenscm.mercurial import match as matchmod
|
||||
from testutil.dott import feature
|
||||
from hghave import require
|
||||
|
||||
|
||||
feature.require(["py2"])
|
||||
require(["py2"])
|
||||
|
||||
|
||||
class NeverMatcherTests(unittest.TestCase):
|
||||
|
@ -3,10 +3,10 @@ from __future__ import absolute_import, print_function
|
||||
import pprint
|
||||
|
||||
from edenscm.mercurial import minirst
|
||||
from testutil.dott import feature
|
||||
from hghave import require
|
||||
|
||||
|
||||
feature.require(["py2"])
|
||||
require(["py2"])
|
||||
|
||||
|
||||
def debugformat(text, form, **kwargs):
|
||||
|
@ -17,10 +17,10 @@ import sys
|
||||
import time
|
||||
|
||||
from edenscm.mercurial import pycompat, store
|
||||
from testutil.dott import feature
|
||||
from hghave import require
|
||||
|
||||
|
||||
feature.require(["py2"])
|
||||
require(["py2"])
|
||||
|
||||
|
||||
try:
|
||||
|
@ -10,10 +10,10 @@ import os
|
||||
import subprocess
|
||||
|
||||
from edenscm.mercurial import hg, localrepo, ui as uimod, util
|
||||
from testutil.dott import feature
|
||||
from hghave import require
|
||||
|
||||
|
||||
feature.require(["py2"])
|
||||
require(["py2"])
|
||||
|
||||
|
||||
# create some special property cache that trace they call
|
||||
|
@ -3,10 +3,10 @@ from __future__ import absolute_import, print_function
|
||||
import os
|
||||
|
||||
from edenscm.mercurial import hg, merge, ui as uimod
|
||||
from testutil.dott import feature
|
||||
from hghave import require
|
||||
|
||||
|
||||
feature.require(["py2"])
|
||||
require(["py2"])
|
||||
|
||||
|
||||
u = uimod.ui.load()
|
||||
|
@ -5,10 +5,10 @@ from __future__ import absolute_import, print_function
|
||||
import sys
|
||||
|
||||
from edenscm.mercurial import encoding, node, revlog, transaction, vfs
|
||||
from testutil.dott import feature
|
||||
from hghave import require
|
||||
|
||||
|
||||
feature.require(["py2"])
|
||||
require(["py2"])
|
||||
|
||||
|
||||
# TESTTMP is optional. This makes it convenient to run without run-tests.py
|
||||
|
@ -9,10 +9,10 @@ import doctest
|
||||
import os
|
||||
import re
|
||||
|
||||
from testutil.dott import feature
|
||||
from hghave import require
|
||||
|
||||
|
||||
feature.require(["py2"])
|
||||
require(["py2"])
|
||||
|
||||
|
||||
# this is hack to make sure no escape characters are inserted into the output
|
||||
|
@ -49,11 +49,6 @@
|
||||
|
||||
from __future__ import absolute_import
|
||||
|
||||
|
||||
from testutil.dott import feature
|
||||
|
||||
feature.require(["py2"])
|
||||
|
||||
import os
|
||||
import thread
|
||||
import threading
|
||||
@ -63,6 +58,10 @@ from thread import get_ident, start_new_thread
|
||||
|
||||
import silenttestrunner
|
||||
from bindings import threading as rustthreading
|
||||
from hghave import require
|
||||
|
||||
|
||||
require(["py2"])
|
||||
|
||||
|
||||
# From test_support.py
|
||||
|
@ -5,10 +5,10 @@ import unittest
|
||||
import silenttestrunner
|
||||
from edenscm.mercurial import error, scmutil
|
||||
from edenscm.mercurial.pycompat import encodeutf8
|
||||
from testutil.dott import feature
|
||||
from hghave import require
|
||||
|
||||
|
||||
feature.require(["py2"])
|
||||
require(["py2"])
|
||||
|
||||
|
||||
class mockfile(object):
|
||||
|
@ -18,10 +18,10 @@ from __future__ import absolute_import
|
||||
import unittest
|
||||
|
||||
from edenscm.mercurial import error, simplemerge, util
|
||||
from testutil.dott import feature
|
||||
from hghave import require
|
||||
|
||||
|
||||
feature.require(["py2"])
|
||||
require(["py2"])
|
||||
|
||||
|
||||
TestCase = unittest.TestCase
|
||||
|
@ -5,10 +5,10 @@ import unittest
|
||||
|
||||
import silenttestrunner
|
||||
from edenscm.mercurial import sshserver, wireproto
|
||||
from testutil.dott import feature
|
||||
from hghave import require
|
||||
|
||||
|
||||
feature.require(["py2"])
|
||||
require(["py2"])
|
||||
|
||||
|
||||
class SSHServerGetArgsTests(unittest.TestCase):
|
||||
|
@ -6,9 +6,9 @@
|
||||
|
||||
import os
|
||||
import sys
|
||||
from testutil.dott import feature
|
||||
from hghave import require
|
||||
|
||||
feature.require(["py2"])
|
||||
require(["py2"])
|
||||
|
||||
if os.name == "nt":
|
||||
sys.exit(80)
|
||||
|
@ -5,10 +5,10 @@ import sys
|
||||
import time
|
||||
|
||||
from edenscm.mercurial import commands, fscap, hg, ui as uimod, util
|
||||
from testutil.dott import feature
|
||||
from hghave import require
|
||||
|
||||
|
||||
feature.require(["py2"])
|
||||
require(["py2"])
|
||||
|
||||
|
||||
TESTDIR = os.environ["TESTDIR"]
|
||||
|
@ -9,10 +9,10 @@ import unittest
|
||||
|
||||
import silenttestrunner
|
||||
from bindings import treestate
|
||||
from testutil.dott import feature
|
||||
from hghave import require
|
||||
|
||||
|
||||
feature.require(["py2"])
|
||||
require(["py2"])
|
||||
|
||||
|
||||
testtmp = os.getenv("TESTTMP") or tempfile.mkdtemp("test-treestate")
|
||||
|
@ -3,10 +3,10 @@ from __future__ import absolute_import, print_function
|
||||
import os
|
||||
|
||||
from edenscm.mercurial import dispatch, ui as uimod
|
||||
from testutil.dott import feature
|
||||
from hghave import require
|
||||
|
||||
|
||||
feature.require(["py2"])
|
||||
require(["py2"])
|
||||
|
||||
|
||||
# ensure errors aren't buffered
|
||||
|
@ -1,10 +1,10 @@
|
||||
from __future__ import absolute_import, print_function
|
||||
|
||||
from edenscm.mercurial import dispatch, error, ui as uimod
|
||||
from testutil.dott import feature
|
||||
from hghave import require
|
||||
|
||||
|
||||
feature.require(["py2"])
|
||||
require(["py2"])
|
||||
|
||||
|
||||
testui = uimod.ui.load()
|
||||
|
@ -3,10 +3,10 @@ from __future__ import absolute_import, print_function
|
||||
import os
|
||||
|
||||
from edenscm.mercurial import ui as uimod
|
||||
from testutil.dott import feature
|
||||
from hghave import require
|
||||
|
||||
|
||||
feature.require(["py2"])
|
||||
require(["py2"])
|
||||
|
||||
|
||||
hgrc = os.environ["HGRCPATH"]
|
||||
|
@ -5,10 +5,10 @@ import doctest
|
||||
import os
|
||||
|
||||
from edenscm.mercurial import sslutil
|
||||
from testutil.dott import feature
|
||||
from hghave import require
|
||||
|
||||
|
||||
feature.require(["py2"])
|
||||
require(["py2"])
|
||||
|
||||
|
||||
def check(a, b):
|
||||
|
@ -11,9 +11,9 @@ unexpected errors and to compare different versions of it."""
|
||||
import os
|
||||
import subprocess
|
||||
import sys
|
||||
from testutil.dott import feature
|
||||
from hghave import require
|
||||
|
||||
feature.require(["py2"])
|
||||
require(["py2"])
|
||||
|
||||
# Only run if slow tests are allowed
|
||||
if subprocess.call(["python", "%s/hghave" % os.environ["TESTDIR"], "slow"]):
|
||||
|
@ -3,10 +3,10 @@ from __future__ import absolute_import, print_function
|
||||
import os
|
||||
|
||||
from edenscm.mercurial import hg, scmutil, ui as uimod, util
|
||||
from testutil.dott import feature
|
||||
from hghave import require
|
||||
|
||||
|
||||
feature.require(["py2"])
|
||||
require(["py2"])
|
||||
|
||||
|
||||
chdir = os.chdir
|
||||
|
@ -1,10 +1,10 @@
|
||||
from __future__ import absolute_import, print_function
|
||||
|
||||
from edenscm.mercurial import ui, util, wireproto
|
||||
from testutil.dott import feature
|
||||
from hghave import require
|
||||
|
||||
|
||||
feature.require(["py2"])
|
||||
require(["py2"])
|
||||
|
||||
|
||||
stringio = util.stringio
|
||||
|
@ -5,10 +5,10 @@ import unittest
|
||||
|
||||
import silenttestrunner
|
||||
from bindings import zstd
|
||||
from testutil.dott import feature
|
||||
from hghave import require
|
||||
|
||||
|
||||
feature.require(["py2"])
|
||||
require(["py2"])
|
||||
|
||||
|
||||
class testzstd(unittest.TestCase):
|
||||
|
Loading…
Reference in New Issue
Block a user