jenkins-bot has submitted this change. ( https://gerrit.wikimedia.org/r/c/pywikibot/core/+/1100409?usp=email )
Change subject: cleanup: remove svn_rev_info and getversion_svn functions from version module ...................................................................... cleanup: remove svn_rev_info and getversion_svn functions from version module SVN repository is no longer supported. Bug: T378898 Change-Id: I8978bbb0f9a48e14624b38b0eeda2005b1f016c1 --- M ROADMAP.rst M pywikibot/version.py 2 files changed, 5 insertions(+), 69 deletions(-) Approvals: Xqt: Looks good to me, approved jenkins-bot: Verified diff --git a/ROADMAP.rst b/ROADMAP.rst index da79765..013f0af 100644 --- a/ROADMAP.rst +++ b/ROADMAP.rst @@ -11,6 +11,8 @@ **Breaking changes and code cleanups** +* ``svn_rev_info`` and ``getversion_svn`` of :mod:`version` module were be removed. + SVN repository is no longer supported. (:phab:`T362484`) * Old color escape sequences like ``\03{color}`` were dropped in favour of new color format like ``<<color>>`` * ``tools.formatter.color_format()`` was removed; the new color literals can be used instead * RedirectPageBot and NoRedirectPageBot bot classes were removed in favour of @@ -85,8 +87,6 @@ Pending removal in Pywikibot 10 ------------------------------- -* 9.1.0: :func:`version.svn_rev_info` and :func:`version.getversion_svn` will be removed. SVN is no longer supported. - (:phab:`T362484`) * 7.7.0: :mod:`tools.threading` classes should no longer imported from :mod:`tools` * 7.6.0: :mod:`tools.itertools` datatypes should no longer imported from :mod:`tools` * 7.6.0: :mod:`tools.collections` datatypes should no longer imported from :mod:`tools` diff --git a/pywikibot/version.py b/pywikibot/version.py index 4daf5a5..4078314 100644 --- a/pywikibot/version.py +++ b/pywikibot/version.py @@ -11,12 +11,11 @@ import os import pathlib import socket -import sqlite3 import subprocess import sys import sysconfig import time -from contextlib import closing, suppress +from contextlib import suppress from importlib import import_module from pathlib import Path from warnings import warn @@ -26,8 +25,7 @@ from pywikibot.backports import cache from pywikibot.comms.http import fetch from pywikibot.exceptions import VersionParseError -from pywikibot.tools import deprecated, suppress_warnings -from pywikibot.tools._deprecate import _NotImplementedWarning +from pywikibot.tools import deprecated def _get_program_dir() -> str: @@ -91,14 +89,10 @@ exceptions = {} for vcs_func in (getversion_git, - getversion_svn, getversion_nightly, getversion_package): try: - with suppress_warnings( - f'.*({vcs_func.__name__}|svn_rev_info) is deprecated since ' - 'release 9.1.', _NotImplementedWarning): - tag, rev, date, hsh = vcs_func(_program_dir) + tag, rev, date, hsh = vcs_func(_program_dir) except Exception as e: exceptions[vcs_func] = vcs_func.__name__, e else: @@ -128,64 +122,6 @@ return {'tag': tag, 'rev': rev, 'date': datestring, 'hsh': hsh} -@deprecated(since='9.1') -def svn_rev_info(path): - """Fetch information about the current revision of a Subversion checkout. - - .. deprecated:: 9.1 - update to git repository. - .. versionchanged:: 9.1 - drop support for svn 1.6 and older. - - :param path: directory of the Subversion checkout - :return: - - tag (name for the repository), - - rev (current Subversion revision identifier), - - date (date of current revision), - :rtype: ``tuple`` of two ``str`` and a ``time.struct_time`` - """ - if not os.path.isdir(os.path.join(path, '.svn')): - path = os.path.join(path, '..') - - with closing( - sqlite3.connect(os.path.join(path, '.svn/wc.db'))) as con: - cur = con.cursor() - cur.execute("""select -local_relpath, repos_path, revision, changed_date, checksum from nodes -order by revision desc, changed_date desc""") - _name, tag, rev, date, _checksum = cur.fetchone() - cur.execute('select root from repository') - tag, = cur.fetchone() - - tag = os.path.split(tag)[1] - date = time.gmtime(date / 1_000_000) - return tag, rev, date - - -@deprecated(since='9.1') -def getversion_svn(path=None): - """Get version info for a Subversion checkout. - - .. deprecated:: 9.1 - update to git repository. - - :param path: directory of the Subversion checkout - :return: - - tag (name for the repository), - - rev (current Subversion revision identifier), - - date (date of current revision), - - hash '(unknown)' - :rtype: ``tuple`` of three ``str`` and a ``time.struct_time`` - """ - _program_dir = path or _get_program_dir() - tag, rev, date = svn_rev_info(_program_dir) - rev = f's{rev}' - - if (not date or not tag or not rev) and not path: - raise VersionParseError - return (tag, rev, date, '(unknown)') - - def getversion_git(path=None): """Get version info for a Git clone. -- To view, visit https://gerrit.wikimedia.org/r/c/pywikibot/core/+/1100409?usp=email To unsubscribe, or for help writing mail filters, visit https://gerrit.wikimedia.org/r/settings?usp=email Gerrit-MessageType: merged Gerrit-Project: pywikibot/core Gerrit-Branch: master Gerrit-Change-Id: I8978bbb0f9a48e14624b38b0eeda2005b1f016c1 Gerrit-Change-Number: 1100409 Gerrit-PatchSet: 1 Gerrit-Owner: Xqt <i...@gno.de> Gerrit-Reviewer: Xqt <i...@gno.de> Gerrit-Reviewer: jenkins-bot
_______________________________________________ Pywikibot-commits mailing list -- pywikibot-commits@lists.wikimedia.org To unsubscribe send an email to pywikibot-commits-le...@lists.wikimedia.org