From 32e4dee76b6cd4b44623299013784009c2d0dc63 Mon Sep 17 00:00:00 2001 From: Romain Failliot Date: Sun, 16 Apr 2023 14:00:03 -0400 Subject: [PATCH] feat: remove support for SVK --- CHANGELOG.md | 4 ++ README.md | 4 +- ....github.mightycreak.Diffuse.appdata.xml.in | 3 +- .../share/gnome/help/diffuse/C/diffuse.xml | 2 +- .../share/gnome/help/diffuse/cs/diffuse.xml | 2 +- .../share/gnome/help/diffuse/it/diffuse.xml | 2 +- .../share/gnome/help/diffuse/ru/diffuse.xml | 2 +- data/usr/share/man/cs/man1/diffuse.1 | 2 +- data/usr/share/man/it/man1/diffuse.1 | 2 +- data/usr/share/man/man1/diffuse.1 | 2 +- data/usr/share/man/ru/man1/diffuse.1 | 2 +- po/POTFILES | 1 - src/diffuse/preferences.py | 10 +-- src/diffuse/vcs/svk.py | 64 ----------------- src/diffuse/vcs/svn.py | 1 - src/diffuse/vcs/vcs_registry.py | 72 ------------------- 16 files changed, 17 insertions(+), 158 deletions(-) delete mode 100644 src/diffuse/vcs/svk.py diff --git a/CHANGELOG.md b/CHANGELOG.md index 9517d21..ed12c9c 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -7,6 +7,10 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 ## Unreleased +### Removed + +- Remove support for the SVK CVS (@MightyCreak) + ## 0.8.2 - 2023-04-16 ### Added diff --git a/README.md b/README.md index 8cf45b1..8ebc1c3 100644 --- a/README.md +++ b/README.md @@ -36,8 +36,7 @@ Some key features of Diffuse: * Ability to directly edit files * Syntax highlighting * Supports several VCS: [Bazaar][bzr], [CVS][cvs], [Darcs][darcs], [Git][git], - [Mercurial][hg], [Monotone][mtn], [RCS][rcs], [Subversion][svn] and - [SVK][svk] + [Mercurial][hg], [Monotone][mtn], [RCS][rcs] and [Subversion][svn] * Unicode support * Unlimited undo * Easy keyboard navigation @@ -50,7 +49,6 @@ Some key features of Diffuse: [mtn]: https://www.monotone.ca [rcs]: https://www.gnu.org/software/rcs/ [svn]: https://subversion.apache.org -[svk]: https://metacpan.org/dist/SVK ## Documentation diff --git a/data/io.github.mightycreak.Diffuse.appdata.xml.in b/data/io.github.mightycreak.Diffuse.appdata.xml.in index f1ffbf7..f336188 100644 --- a/data/io.github.mightycreak.Diffuse.appdata.xml.in +++ b/data/io.github.mightycreak.Diffuse.appdata.xml.in @@ -5,7 +5,8 @@ Graphical tool for merging and comparing text files

- Diffuse is a graphical tool for comparing and merging text files. It can retrieve files for comparison from Bazaar, CVS, Darcs, Git, Mercurial, Monotone, RCS, Subversion, and SVK repositories. + Diffuse is a graphical tool for comparing and merging text files. It can retrieve files for comparison from + Bazaar, CVS, Darcs, Git, Mercurial, Monotone, RCS, and Subversion repositories.

diff --git a/data/usr/share/gnome/help/diffuse/C/diffuse.xml b/data/usr/share/gnome/help/diffuse/C/diffuse.xml index 3e19bb6..0646180 100644 --- a/data/usr/share/gnome/help/diffuse/C/diffuse.xml +++ b/data/usr/share/gnome/help/diffuse/C/diffuse.xml @@ -34,7 +34,7 @@ is able to compare an arbitrary number of files side-by-side and gives users the ability to manually adjust line matching and directly edit files. &app; can also retrieve revisions of files from Bazaar, CVS, - Darcs, Git, Mercurial, Monotone, RCS, Subversion, and SVK repositories + Darcs, Git, Mercurial, Monotone, RCS, and Subversion repositories for comparison and merging. diff --git a/data/usr/share/gnome/help/diffuse/cs/diffuse.xml b/data/usr/share/gnome/help/diffuse/cs/diffuse.xml index bec3927..e7fa4e5 100644 --- a/data/usr/share/gnome/help/diffuse/cs/diffuse.xml +++ b/data/usr/share/gnome/help/diffuse/cs/diffuse.xml @@ -37,7 +37,7 @@ Úvod - &app; je grafický nástroj pro slučování a porovnávání textových souborů. &app; dokáže porovnat libovolný počet souborů a nabízí uživatelům možnost ručně upravit zarovnání řádků a přímo upravovat porovnávané soubory. &app; také umí načíst k porovnání a slučování revize souborů přímo z repozitářů Bazaar, CVS, Darcs, Git, Mercurial, Monotone, RCS, Subversion a SVK. + &app; je grafický nástroj pro slučování a porovnávání textových souborů. &app; dokáže porovnat libovolný počet souborů a nabízí uživatelům možnost ručně upravit zarovnání řádků a přímo upravovat porovnávané soubory. &app; také umí načíst k porovnání a slučování revize souborů přímo z repozitářů Bazaar, CVS, Darcs, Git, Mercurial, Monotone, RCS a Subversion. O programu diff --git a/data/usr/share/gnome/help/diffuse/it/diffuse.xml b/data/usr/share/gnome/help/diffuse/it/diffuse.xml index d4b4a2d..156d79d 100644 --- a/data/usr/share/gnome/help/diffuse/it/diffuse.xml +++ b/data/usr/share/gnome/help/diffuse/it/diffuse.xml @@ -35,7 +35,7 @@ Introduzione - &app; è uno strumento grafico per l'unione e il confronto di file di testo. &app; è in grado di confrontare uno a fianco all'altro un qualsiasi numero di file e fornisce all'utente la possibilità di correggere manualmente la corrispondenza fra le righe e di modificare i file. &app; è anche in grado di recuperare le revisioni dei file dai repository Bazaar, CVS, Darcs, Git, Mercurial, Monotone, RCS, Subversion e SVK per confrontarle e unirle. + &app; è uno strumento grafico per l'unione e il confronto di file di testo. &app; è in grado di confrontare uno a fianco all'altro un qualsiasi numero di file e fornisce all'utente la possibilità di correggere manualmente la corrispondenza fra le righe e di modificare i file. &app; è anche in grado di recuperare le revisioni dei file dai repository Bazaar, CVS, Darcs, Git, Mercurial, Monotone, RCS e Subversion per confrontarle e unirle. Informazioni diff --git a/data/usr/share/gnome/help/diffuse/ru/diffuse.xml b/data/usr/share/gnome/help/diffuse/ru/diffuse.xml index e867499..67a92b7 100644 --- a/data/usr/share/gnome/help/diffuse/ru/diffuse.xml +++ b/data/usr/share/gnome/help/diffuse/ru/diffuse.xml @@ -41,7 +41,7 @@ представлении бок о бок, предоставляет пользователям возможность вручную корректировать соответствие строк и редактировать файлы напрямую. &app; может также извлекать ревизии файлов из Bazaar, CVS, Darcs, Git, - Mercurial, Monotone, RCS, Subversion и SVK репозиториев для их сравнения + Mercurial, Monotone, RCS и Subversion репозиториев для их сравнения и слияния. diff --git a/data/usr/share/man/cs/man1/diffuse.1 b/data/usr/share/man/cs/man1/diffuse.1 index 5961340..f01a3e4 100644 --- a/data/usr/share/man/cs/man1/diffuse.1 +++ b/data/usr/share/man/cs/man1/diffuse.1 @@ -18,7 +18,7 @@ je grafický nástroj pro slučování a porovnávání textových souborů\&. Diffuse dokáže porovnat libovolný počet souborů a nabízí uživatelům možnost ručně upravit zarovnání řádků a přímo upravovat porovnávané soubory\&. Diffuse -také umí načíst k porovnání a slučování revize souborů přímo z repozitářů Bazaar, CVS, Darcs, Git, Mercurial, Monotone, RCS, Subversion a SVK\&. +také umí načíst k porovnání a slučování revize souborů přímo z repozitářů Bazaar, CVS, Darcs, Git, Mercurial, Monotone, RCS a Subversion\&. .SH "MOŽNOSTI" .SS "Možnosti nápovědy" .PP diff --git a/data/usr/share/man/it/man1/diffuse.1 b/data/usr/share/man/it/man1/diffuse.1 index d9abcb1..3d2196e 100644 --- a/data/usr/share/man/it/man1/diffuse.1 +++ b/data/usr/share/man/it/man1/diffuse.1 @@ -18,7 +18,7 @@ Diffuse Diffuse è in grado di confrontare uno a fianco all\*(Aqaltro un qualsiasi numero di file e fornisce all\*(Aqutente la possibilità di correggere manualmente la corrispondenza fra le righe e di modificare i file\&. Diffuse -è anche in grado di recuperare le revisioni dei file dai repository Bazaar, CVS, Darcs, Git, Mercurial, Monotone, RCS, Subversion e SVK per confrontarle e unirle\&. +è anche in grado di recuperare le revisioni dei file dai repository Bazaar, CVS, Darcs, Git, Mercurial, Monotone, RCS e Subversion per confrontarle e unirle\&. .SH "OPZIONI" .SS "Opzioni di aiuto" .PP diff --git a/data/usr/share/man/man1/diffuse.1 b/data/usr/share/man/man1/diffuse.1 index fd155c8..02eaceb 100644 --- a/data/usr/share/man/man1/diffuse.1 +++ b/data/usr/share/man/man1/diffuse.1 @@ -18,7 +18,7 @@ is a graphical tool for merging and comparing text files\&. Diffuse is able to compare an arbitrary number of files side\-by\-side and gives users the ability to manually adjust line matching and directly edit files\&. Diffuse -can also retrieve revisions of files from Bazaar, CVS, Darcs, Git, Mercurial, Monotone, RCS, Subversion, and SVK repositories for comparison and merging\&. +can also retrieve revisions of files from Bazaar, CVS, Darcs, Git, Mercurial, Monotone, RCS and Subversion repositories for comparison and merging\&. .SH "OPTIONS" .SS "Help Options" .PP diff --git a/data/usr/share/man/ru/man1/diffuse.1 b/data/usr/share/man/ru/man1/diffuse.1 index b215d55..db25a9f 100644 --- a/data/usr/share/man/ru/man1/diffuse.1 +++ b/data/usr/share/man/ru/man1/diffuse.1 @@ -17,7 +17,7 @@ diffuse \- графический инструмент для слияния и Diffuse является графическим инструментом для слияния и сравнения текстовых файлов\&. Она может сравнить произвольное число файлов в представлении бок о бок, предоставляет пользователям возможность вручную корректировать соответствие строк и редактировать файлы напрямую\&. Diffuse -может также извлекать ревизии файлов из Bazaar, CVS, Darcs, Git, Mercurial, Monotone, RCS, Subversion и SVK репозиториев для их сравнения и слияния\&. +может также извлекать ревизии файлов из Bazaar, CVS, Darcs, Git, Mercurial, Monotone, RCS и Subversion репозиториев для их сравнения и слияния\&. .SH "ОПЦИИ" .SS "Параметры Справки" .PP diff --git a/po/POTFILES b/po/POTFILES index 04b489d..1d60702 100644 --- a/po/POTFILES +++ b/po/POTFILES @@ -18,7 +18,6 @@ src/diffuse/vcs/git.py src/diffuse/vcs/hg.py src/diffuse/vcs/mtn.py src/diffuse/vcs/rcs.py -src/diffuse/vcs/svk.py src/diffuse/vcs/svn.py src/diffuse/vcs/vcs_interface.py src/diffuse/vcs/vcs_registry.py diff --git a/src/diffuse/preferences.py b/src/diffuse/preferences.py index 9be157c..750fce5 100644 --- a/src/diffuse/preferences.py +++ b/src/diffuse/preferences.py @@ -47,11 +47,6 @@ class Preferences: # find available encodings self.encodings: List[Optional[str]] = sorted(set(encodings.aliases.aliases.values())) - if utils.isWindows(): - svk_bin = 'svk.bat' - else: - svk_bin = 'svk' - auto_detect_codecs = ['utf_8', 'utf_16', 'latin_1'] e = utils.norm_encoding(sys.getfilesystemencoding()) if e is not None and e not in auto_detect_codecs: @@ -154,14 +149,13 @@ class Preferences: ('hg', 'Mercurial', 'hg'), ('mtn', 'Monotone', 'mtn'), ('rcs', 'RCS', None), - ('svn', 'Subversion', 'svn'), - ('svk', 'SVK', svk_bin)] + ('svn', 'Subversion', 'svn')] vcs_template = [ 'List', [ 'String', 'vcs_search_order', - 'bzr cvs darcs git hg mtn rcs svn svk', + 'bzr cvs darcs git hg mtn rcs svn', _('Version control system search order') ] ] diff --git a/src/diffuse/vcs/svk.py b/src/diffuse/vcs/svk.py deleted file mode 100644 index 8cf3ca6..0000000 --- a/src/diffuse/vcs/svk.py +++ /dev/null @@ -1,64 +0,0 @@ -# Diffuse: a graphical tool for merging and comparing text files. -# -# Copyright (C) 2019 Derrick Moser -# Copyright (C) 2021 Romain Failliot -# -# This program is free software; you can redistribute it and/or modify -# it under the terms of the GNU General Public License as published by -# the Free Software Foundation; either version 2 of the License, or -# (at your option) any later version. -# -# This program is distributed in the hope that it will be useful, -# but WITHOUT ANY WARRANTY; without even the implied warranty of -# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -# GNU General Public License for more details. -# -# You should have received a copy of the GNU General Public License along -# with this program; if not, write to the Free Software Foundation, Inc., -# 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. - -import os - -from typing import Optional, Tuple - -from diffuse import utils -from diffuse.preferences import Preferences -from diffuse.vcs.svn import Svn - - -class Svk(Svn): - @staticmethod - def _getVcs() -> str: - return 'svk' - - @staticmethod - def _getURLPrefix() -> str: - return 'Depot Path: ' - - @staticmethod - def _parseStatusLine(s: str) -> Tuple[str, str]: - if len(s) < 4 or s[0] not in 'ACDMR': - return '', '' - return s[0], s[4:] - - @staticmethod - def _getPreviousRevision(rev: Optional[str]) -> str: - if rev is None: - return 'HEAD' - if rev.endswith('@'): - return str(int(rev[:-1]) - 1) + '@' - return str(int(rev) - 1) - - def getRevision(self, prefs: Preferences, name: str, rev: str) -> bytes: - relpath = utils.relpath(self.root, os.path.abspath(name)).replace(os.sep, '/') - return utils.popenRead( - self.root, - [ - prefs.getString('svk_bin'), - 'cat', - '-r', - rev, - f'{self._getURL(prefs)}/{relpath}' - ], - prefs, - 'svk_bash') diff --git a/src/diffuse/vcs/svn.py b/src/diffuse/vcs/svn.py index 8d54af9..8e2d3bd 100644 --- a/src/diffuse/vcs/svn.py +++ b/src/diffuse/vcs/svn.py @@ -30,7 +30,6 @@ from diffuse.vcs.vcs_interface import VcsInterface # Subversion support -# SVK support subclasses from this class Svn(VcsInterface): def __init__(self, root: str): super().__init__(root) diff --git a/src/diffuse/vcs/vcs_registry.py b/src/diffuse/vcs/vcs_registry.py index 84bedca..074447d 100644 --- a/src/diffuse/vcs/vcs_registry.py +++ b/src/diffuse/vcs/vcs_registry.py @@ -19,12 +19,10 @@ import os -from gettext import gettext as _ from typing import List, Optional from diffuse import utils from diffuse.preferences import Preferences -from diffuse.vcs.folder_set import FolderSet from diffuse.vcs.vcs_interface import VcsInterface from diffuse.vcs.bzr import Bzr from diffuse.vcs.cvs import Cvs @@ -33,7 +31,6 @@ from diffuse.vcs.git import Git from diffuse.vcs.hg import Hg from diffuse.vcs.mtn import Mtn from diffuse.vcs.rcs import Rcs -from diffuse.vcs.svk import Svk from diffuse.vcs.svn import Svn @@ -48,7 +45,6 @@ class VcsRegistry: 'hg': _get_hg_repo, 'mtn': _get_mtn_repo, 'rcs': _get_rcs_repo, - 'svk': _get_svk_repo, 'svn': _get_svn_repo } @@ -169,71 +165,3 @@ def _get_rcs_repo(path: str, prefs: Preferences) -> Optional[VcsInterface]: def _get_svn_repo(path: str, prefs: Preferences) -> Optional[VcsInterface]: p = _find_parent_dir_with(path, '.svn') return Svn(p) if p else None - - -def _get_svk_repo(path: str, prefs: Preferences) -> Optional[VcsInterface]: - name = path - # parse the ~/.svk/config file to discover which directories are part of - # SVK repositories - if utils.isWindows(): - name = name.upper() - svkroot = os.environ.get('SVKROOT', None) - if svkroot is None: - svkroot = os.path.expanduser('~/.svk') - svkconfig = os.path.join(svkroot, 'config') - if os.path.isfile(svkconfig): - try: - # find working copies by parsing the config file - with open(svkconfig, 'r', encoding='utf-8') as f: - ss: List[str] = utils.readlines(f) - projs: List[str] = [] - sep = os.sep - # find the separator character - for s in ss: - if s.startswith(' sep: ') and len(s) > 7: - sep = s[7] - # find the project directories - i = 0 - while i < len(ss): - s = ss[i] - i += 1 - if s.startswith(' hash: '): - while i < len(ss) and ss[i].startswith(' '): - s = ss[i] - i += 1 - if ( - s.endswith(': ') and - i < len(ss) and - ss[i].startswith(' depotpath: ') - ): - key = s[4:-2].replace(sep, os.sep) - # parse directory path - j, n, tt = 0, len(key), [] - while j < n: - if key[j] == '"': - # quoted string - j += 1 - while j < n: - if key[j] == '"': - j += 1 - break - if key[j] == '\\': - # escaped character - j += 1 - if j < n: - tt.append(key[j]) - j += 1 - else: - tt.append(key[j]) - j += 1 - key = ''.join(tt).replace(sep, os.sep) - if utils.isWindows(): - key = key.upper() - projs.append(key) - break - # check if the file belongs to one of the project directories - if FolderSet(projs).contains(name): - return Svk(path) - except IOError: - utils.logError(_('Error parsing %s.') % (svkconfig, )) - return None