From 761162e67f7366982918d58f8704166e93f1eae4 Mon Sep 17 00:00:00 2001 From: a_rubashev Date: Tue, 5 Mar 2019 18:25:52 +0200 Subject: [PATCH 01/13] svn status can now include changelists' items --- svn/common.py | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/svn/common.py b/svn/common.py index e3dcda6..46eb5ef 100644 --- a/svn/common.py +++ b/svn/common.py @@ -1,14 +1,13 @@ import collections import logging import os -import subprocess import xml.etree.ElementTree import dateutil.parser +import svn.common_base import svn.constants import svn.exception -import svn.common_base _LOGGER = logging.getLogger(__name__) @@ -288,7 +287,7 @@ def export(self, to_path, revision=None, force=False): self.run_command('export', cmd) - def status(self, rel_path=None): + def status(self, rel_path=None, include_changelists=False): full_url_or_path = self.__url_or_path if rel_path is not None: full_url_or_path += '/' + rel_path @@ -301,6 +300,9 @@ def status(self, rel_path=None): root = xml.etree.ElementTree.fromstring(raw) list_ = root.findall('target/entry') + if include_changelists is True: + list_ += root.findall('changelist/entry') + for entry in list_: entry_attr = entry.attrib name = entry_attr['path'] From 047e25ad842492fb82399f6a7fd150b2a292928d Mon Sep 17 00:00:00 2001 From: a_rubashev Date: Tue, 5 Mar 2019 19:14:52 +0200 Subject: [PATCH 02/13] version bump --- svn/__init__.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/svn/__init__.py b/svn/__init__.py index f63465b..2719f02 100644 --- a/svn/__init__.py +++ b/svn/__init__.py @@ -1 +1 @@ -__version__ = '0.3.46' +__version__ = '0.3.47' From e54a902b3fcb186c247dbe4b378487bc7cc93faa Mon Sep 17 00:00:00 2001 From: a_rubashev Date: Thu, 30 May 2019 15:23:12 +0300 Subject: [PATCH 03/13] ! non-interactive removed by default --- svn/common.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/svn/common.py b/svn/common.py index 46eb5ef..76512a1 100644 --- a/svn/common.py +++ b/svn/common.py @@ -39,7 +39,7 @@ def __init__(self, url_or_path, type_, username=None, password=None, self.__type = type_ def run_command(self, subcommand, args, **kwargs): - cmd = [self.__svn_filepath, '--non-interactive'] + cmd = [self.__svn_filepath] if self.__trust_cert: cmd += ['--trust-server-cert'] From 0475d9ca3f87975956020facd2361294573e39a8 Mon Sep 17 00:00:00 2001 From: a_rubashev Date: Thu, 30 May 2019 15:37:09 +0300 Subject: [PATCH 04/13] ! version bump --- svn/__init__.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/svn/__init__.py b/svn/__init__.py index 2719f02..5d3bf41 100644 --- a/svn/__init__.py +++ b/svn/__init__.py @@ -1 +1 @@ -__version__ = '0.3.47' +__version__ = '0.3.48' From c19001cc5327ba3a666ff39f222849063f1223ae Mon Sep 17 00:00:00 2001 From: a_rubashev Date: Tue, 15 Oct 2019 16:24:53 +0300 Subject: [PATCH 05/13] ! diff bugfix --- svn/__init__.py | 2 +- svn/common.py | 3 +-- 2 files changed, 2 insertions(+), 3 deletions(-) diff --git a/svn/__init__.py b/svn/__init__.py index 5d3bf41..317ec69 100644 --- a/svn/__init__.py +++ b/svn/__init__.py @@ -1 +1 @@ -__version__ = '0.3.48' +__version__ = '0.3.49' diff --git a/svn/common.py b/svn/common.py index 76512a1..7f8d0c4 100644 --- a/svn/common.py +++ b/svn/common.py @@ -461,8 +461,7 @@ def diff(self, old, new, rel_path=None): file_to_diff[split_diff[0].strip().strip('/')] = split_diff[-1].strip('=').strip() diff_summaries = self.diff_summary(old, new, rel_path) for diff_summary in diff_summaries: - diff_summary['diff'] = \ - file_to_diff[diff_summary['path'].split(full_url_or_path)[-1].strip('/')] + diff_summary['diff'] = file_to_diff[diff_summary['path'].split('/')[-1]] return diff_summaries @property From 49a3d87b5658b8dbef22ded540889f1a4a96e56d Mon Sep 17 00:00:00 2001 From: a_rubashev Date: Fri, 12 Jun 2020 17:18:02 +0300 Subject: [PATCH 06/13] ! trust-server-cert bugfix: --non-interactive added, as these flags are mutualy inclusive --- svn/common.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/svn/common.py b/svn/common.py index 7f8d0c4..6a337d7 100644 --- a/svn/common.py +++ b/svn/common.py @@ -42,7 +42,7 @@ def run_command(self, subcommand, args, **kwargs): cmd = [self.__svn_filepath] if self.__trust_cert: - cmd += ['--trust-server-cert'] + cmd += ['--trust-server-cert', '--non-interactive'] if self.__username is not None and self.__password is not None: cmd += ['--username', self.__username] From 1a58d413fa73b37d04c1d9e53fe9fdb4db8f5263 Mon Sep 17 00:00:00 2001 From: a_rubashev Date: Fri, 12 Jun 2020 17:26:36 +0300 Subject: [PATCH 07/13] ! version bump --- svn/__init__.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/svn/__init__.py b/svn/__init__.py index 317ec69..480149d 100644 --- a/svn/__init__.py +++ b/svn/__init__.py @@ -1 +1 @@ -__version__ = '0.3.49' +__version__ = '0.3.50' From 6c43e300b5c86570957a49b06cf63fd44603e04a Mon Sep 17 00:00:00 2001 From: Aleksei Rubashev Date: Wed, 1 Nov 2023 15:53:53 +0200 Subject: [PATCH 08/13] ! poetry publish --- pyproject.toml | 21 +++++++++++++++++++++ 1 file changed, 21 insertions(+) create mode 100644 pyproject.toml diff --git a/pyproject.toml b/pyproject.toml new file mode 100644 index 0000000..4367c08 --- /dev/null +++ b/pyproject.toml @@ -0,0 +1,21 @@ +[tool.poetry] +name = "PySVN" +version = "1.19.18" +description = "The pythonic interface to Subversion. Fork." +authors = [] +maintainers = ["Aleksei Rubashev "] +packages = [ + { include = "svn" }, +] + +[tool.poetry.dependencies] +python = ">=2.7.18" +python-dateutil = ">=2.2" + +[tool.poetry.dev-dependencies] +poetry = "*" # +pytest = ">=4.6" + +[build-system] +requires = ["poetry-core>=1.0.0"] +build-backend = "poetry.core.masonry.api" From 254f12e201c38ba573d85835daeb6b8c78a67252 Mon Sep 17 00:00:00 2001 From: Aleksei Rubashev Date: Wed, 1 Nov 2023 15:56:32 +0200 Subject: [PATCH 09/13] ! v1.19.19 ! poetry publish cmd --- publish.cmd | 11 +++++++++++ pyproject.toml | 2 +- 2 files changed, 12 insertions(+), 1 deletion(-) create mode 100644 publish.cmd diff --git a/publish.cmd b/publish.cmd new file mode 100644 index 0000000..da06286 --- /dev/null +++ b/publish.cmd @@ -0,0 +1,11 @@ + +@echo off +set PYPI_REPO_NAME=artifactory_upload + +choice /C YN /m "Did you change the version?" +if ["%errorlevel%"]==["2"] exit /b + +echo Publishing +poetry publish --repository %PYPI_REPO_NAME% --build %* + +echo -i https://artifactory.wgdp.io/artifactory/api/pypi/wotk-pypi-wotdevtool/simple/ --extra-index-url https://artifactory.wgdp.io/artifactory/api/pypi/wotd-pypi/simple/ --extra-index-url https://pypi.python.org/simple diff --git a/pyproject.toml b/pyproject.toml index 4367c08..59a4ac0 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -1,6 +1,6 @@ [tool.poetry] name = "PySVN" -version = "1.19.18" +version = "1.19.19" description = "The pythonic interface to Subversion. Fork." authors = [] maintainers = ["Aleksei Rubashev "] From dad1ef254306920cc23b26b9ba73ab816ae19acc Mon Sep 17 00:00:00 2001 From: Aleksei Rubashev Date: Mon, 9 Jun 2025 17:31:43 +0300 Subject: [PATCH 10/13] proper imports --- svn/common.py | 6 +++--- svn/constants.py | 12 ++++++++++++ svn/local.py | 13 ++----------- 3 files changed, 17 insertions(+), 14 deletions(-) diff --git a/svn/common.py b/svn/common.py index 1bb7bda..af34eae 100644 --- a/svn/common.py +++ b/svn/common.py @@ -5,7 +5,7 @@ import dateutil.parser -import svn.common_base +from svn.common_base import CommonBase import svn.constants import svn.exception @@ -18,7 +18,7 @@ _HUNK_HEADER_LINE_NUMBERS_PREFIX = '@@ ' -class CommonClient(svn.common_base.CommonBase): +class CommonClient(CommonBase): def __init__(self, url_or_path, type_, username=None, password=None, svn_filepath='svn', trust_cert=None, env={}, *args, **kwargs): super(CommonClient, self).__init__(*args, **kwargs) @@ -316,7 +316,7 @@ def status(self, rel_path=None, include_changelists=False): if revision is not None: revision = int(revision) - yield _STATUS_ENTRY( + yield svn.constants._STATUS_ENTRY( name=name, type_raw_name=change_type_raw, type=change_type, diff --git a/svn/constants.py b/svn/constants.py index 7bfee62..213a11f 100644 --- a/svn/constants.py +++ b/svn/constants.py @@ -1,3 +1,15 @@ +import collections + +_STATUS_ENTRY = \ + collections.namedtuple( + '_STATUS_ENTRY', [ + 'name', + 'type_raw_name', + 'type', + 'revision', + ]) + + # Kinds K_DIR = 'dir' diff --git a/svn/local.py b/svn/local.py index ff4e22d..3f619ba 100644 --- a/svn/local.py +++ b/svn/local.py @@ -1,19 +1,10 @@ import os -import collections import xml.etree import svn.constants -import svn.common +from svn.common import CommonClient -_STATUS_ENTRY = \ - collections.namedtuple( - '_STATUS_ENTRY', [ - 'name', - 'type_raw_name', - 'type', - 'revision', - ]) class LocalClient(svn.common.CommonClient): @@ -95,7 +86,7 @@ def status(self, rel_path=None, include_changelists=False): if revision is not None: revision = int(revision) - yield _STATUS_ENTRY( + yield svn.constants._STATUS_ENTRY( name=name, type_raw_name=change_type_raw, type=change_type, From a6f3ecfd248d6e41a8370c80dff4e46e7228c338 Mon Sep 17 00:00:00 2001 From: Aleksei Rubashev Date: Mon, 9 Jun 2025 17:32:08 +0300 Subject: [PATCH 11/13] optional path existence check --- svn/local.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/svn/local.py b/svn/local.py index 3f619ba..07e8a62 100644 --- a/svn/local.py +++ b/svn/local.py @@ -7,9 +7,9 @@ -class LocalClient(svn.common.CommonClient): - def __init__(self, path_, *args, **kwargs): - if os.path.exists(path_) is False: +class LocalClient(CommonClient): + def __init__(self, path_, allow_nonexistent=False, *args, **kwargs): + if not allow_nonexistent and os.path.exists(path_) is False: raise EnvironmentError("Path does not exist: %s" % path_) super(LocalClient, self).__init__( From 0885e25b74d4b1b5c8a6869b33cd71880fbdbf4f Mon Sep 17 00:00:00 2001 From: Aleksei Rubashev Date: Mon, 9 Jun 2025 17:32:19 +0300 Subject: [PATCH 12/13] v1.19.21 --- poetry.lock | 33 +++++++++++++++++++++++++++++++++ publish.cmd | 2 ++ pyproject.toml | 9 +++++++-- 3 files changed, 42 insertions(+), 2 deletions(-) create mode 100644 poetry.lock diff --git a/poetry.lock b/poetry.lock new file mode 100644 index 0000000..e7818a5 --- /dev/null +++ b/poetry.lock @@ -0,0 +1,33 @@ +[[package]] +name = "python-dateutil" +version = "2.6.1" +description = "Extensions to the standard Python datetime module" +category = "main" +optional = false +python-versions = "*" + +[package.dependencies] +six = ">=1.5" + +[[package]] +name = "six" +version = "1.11.0" +description = "Python 2 and 3 compatibility utilities" +category = "main" +optional = false +python-versions = "*" + +[metadata] +lock-version = "1.1" +python-versions = ">=2.7.18" +content-hash = "6bc126a04fb1701e58134be5a0900b5f3a4a266c44b274797f59eff1357f2c92" + +[metadata.files] +python-dateutil = [ + {file = "python-dateutil-2.6.1.tar.gz", hash = "sha256:891c38b2a02f5bb1be3e4793866c8df49c7d19baabf9c1bad62547e0b4866aca"}, + {file = "python_dateutil-2.6.1-py2.py3-none-any.whl", hash = "sha256:95511bae634d69bc7329ba55e646499a842bc4ec342ad54a8cdb65645a0aad3c"}, +] +six = [ + {file = "six-1.11.0-py2.py3-none-any.whl", hash = "sha256:832dc0e10feb1aa2c68dcc57dbb658f1c7e65b9b61af69048abc87a2db00a0eb"}, + {file = "six-1.11.0.tar.gz", hash = "sha256:70e8a77beed4562e7f14fe23a786b54f6296e34344c23bc42f07b15018ff98e9"}, +] diff --git a/publish.cmd b/publish.cmd index da06286..ea3957c 100644 --- a/publish.cmd +++ b/publish.cmd @@ -2,6 +2,7 @@ @echo off set PYPI_REPO_NAME=artifactory_upload + choice /C YN /m "Did you change the version?" if ["%errorlevel%"]==["2"] exit /b @@ -9,3 +10,4 @@ echo Publishing poetry publish --repository %PYPI_REPO_NAME% --build %* echo -i https://artifactory.wgdp.io/artifactory/api/pypi/wotk-pypi-wotdevtool/simple/ --extra-index-url https://artifactory.wgdp.io/artifactory/api/pypi/wotd-pypi/simple/ --extra-index-url https://pypi.python.org/simple +echo if this fails - activate python 3.12 venv first diff --git a/pyproject.toml b/pyproject.toml index 59a4ac0..805194f 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -1,6 +1,6 @@ [tool.poetry] name = "PySVN" -version = "1.19.19" +version = "1.19.21" description = "The pythonic interface to Subversion. Fork." authors = [] maintainers = ["Aleksei Rubashev "] @@ -12,7 +12,12 @@ packages = [ python = ">=2.7.18" python-dateutil = ">=2.2" -[tool.poetry.dev-dependencies] +[[tool.poetry.source]] +name = "artifactory_upload" +url = "https://artifactory.wgdp.io/artifactory/api/pypi/wotk-pypi-wotdevtool/simple" +priority = "primary" + +[poetry.group.dev.dependencies] poetry = "*" # pytest = ">=4.6" From 3272e967732b1fb31c3d0ef5bac4f838b659c71b Mon Sep 17 00:00:00 2001 From: Aleksei Rubashev Date: Mon, 9 Jun 2025 18:53:18 +0300 Subject: [PATCH 13/13] local client allow nonexistent default on --- svn/local.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/svn/local.py b/svn/local.py index 07e8a62..9e98a5b 100644 --- a/svn/local.py +++ b/svn/local.py @@ -8,7 +8,7 @@ class LocalClient(CommonClient): - def __init__(self, path_, allow_nonexistent=False, *args, **kwargs): + def __init__(self, path_, allow_nonexistent=True, *args, **kwargs): if not allow_nonexistent and os.path.exists(path_) is False: raise EnvironmentError("Path does not exist: %s" % path_)