feat: remove support for SVK

This commit is contained in:
Romain Failliot 2023-04-16 14:00:03 -04:00
parent 8e9e002482
commit 32e4dee76b
16 changed files with 17 additions and 158 deletions

View File

@ -7,6 +7,10 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
## Unreleased ## Unreleased
### Removed
- Remove support for the SVK CVS (@MightyCreak)
## 0.8.2 - 2023-04-16 ## 0.8.2 - 2023-04-16
### Added ### Added

View File

@ -36,8 +36,7 @@ Some key features of Diffuse:
* Ability to directly edit files * Ability to directly edit files
* Syntax highlighting * Syntax highlighting
* Supports several VCS: [Bazaar][bzr], [CVS][cvs], [Darcs][darcs], [Git][git], * Supports several VCS: [Bazaar][bzr], [CVS][cvs], [Darcs][darcs], [Git][git],
[Mercurial][hg], [Monotone][mtn], [RCS][rcs], [Subversion][svn] and [Mercurial][hg], [Monotone][mtn], [RCS][rcs] and [Subversion][svn]
[SVK][svk]
* Unicode support * Unicode support
* Unlimited undo * Unlimited undo
* Easy keyboard navigation * Easy keyboard navigation
@ -50,7 +49,6 @@ Some key features of Diffuse:
[mtn]: https://www.monotone.ca [mtn]: https://www.monotone.ca
[rcs]: https://www.gnu.org/software/rcs/ [rcs]: https://www.gnu.org/software/rcs/
[svn]: https://subversion.apache.org [svn]: https://subversion.apache.org
[svk]: https://metacpan.org/dist/SVK
## Documentation ## Documentation

View File

@ -5,7 +5,8 @@
<summary>Graphical tool for merging and comparing text files</summary> <summary>Graphical tool for merging and comparing text files</summary>
<description> <description>
<p> <p>
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.
</p> </p>
</description> </description>
<supports> <supports>

View File

@ -34,7 +34,7 @@
is able to compare an arbitrary number of files side-by-side and gives 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 users the ability to manually adjust line matching and directly edit
files. <application>&app;</application> can also retrieve revisions of files from Bazaar, CVS, files. <application>&app;</application> 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. for comparison and merging.
</para> </para>

View File

@ -37,7 +37,7 @@
<title>Úvod</title> <title>Úvod</title>
<para> <para>
<application>&app;</application> je grafický nástroj pro slučování a porovnávání textových souborů. <application>&app;</application> 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. <application>&app;</application> 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.</para> <application>&app;</application> je grafický nástroj pro slučování a porovnávání textových souborů. <application>&app;</application> 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. <application>&app;</application> 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.</para>
<sect1 id="introduction-about"> <sect1 id="introduction-about">
<title>O programu</title> <title>O programu</title>

View File

@ -35,7 +35,7 @@
<chapter id="introduction"> <chapter id="introduction">
<title>Introduzione</title> <title>Introduzione</title>
<para><application>&app;</application> è uno strumento grafico per l'unione e il confronto di file di testo. <application>&app;</application> è 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. <application>&app;</application> è 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.</para> <para><application>&app;</application> è uno strumento grafico per l'unione e il confronto di file di testo. <application>&app;</application> è 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. <application>&app;</application> è anche in grado di recuperare le revisioni dei file dai repository Bazaar, CVS, Darcs, Git, Mercurial, Monotone, RCS e Subversion per confrontarle e unirle.</para>
<sect1 id="introduction-about"> <sect1 id="introduction-about">
<title>Informazioni</title> <title>Informazioni</title>

View File

@ -41,7 +41,7 @@
представлении бок о бок, предоставляет пользователям возможность вручную представлении бок о бок, предоставляет пользователям возможность вручную
корректировать соответствие строк и редактировать файлы напрямую. <application>&app;</application> корректировать соответствие строк и редактировать файлы напрямую. <application>&app;</application>
может также извлекать ревизии файлов из Bazaar, CVS, Darcs, Git, может также извлекать ревизии файлов из Bazaar, CVS, Darcs, Git,
Mercurial, Monotone, RCS, Subversion и SVK репозиториев для их сравнения Mercurial, Monotone, RCS и Subversion репозиториев для их сравнения
и слияния. и слияния.
</para> </para>

View File

@ -18,7 +18,7 @@ je grafický nástroj pro slučování a porovnávání textových souborů\&.
Diffuse 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\&. 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 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" .SH "MOŽNOSTI"
.SS "Možnosti nápovědy" .SS "Možnosti nápovědy"
.PP .PP

View File

@ -18,7 +18,7 @@ Diffuse
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\&. è 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 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" .SH "OPZIONI"
.SS "Opzioni di aiuto" .SS "Opzioni di aiuto"
.PP .PP

View File

@ -18,7 +18,7 @@ is a graphical tool for merging and comparing text files\&.
Diffuse 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\&. 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 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" .SH "OPTIONS"
.SS "Help Options" .SS "Help Options"
.PP .PP

View File

@ -17,7 +17,7 @@ diffuse \- графический инструмент для слияния и
Diffuse Diffuse
является графическим инструментом для слияния и сравнения текстовых файлов\&. Она может сравнить произвольное число файлов в представлении бок о бок, предоставляет пользователям возможность вручную корректировать соответствие строк и редактировать файлы напрямую\&. является графическим инструментом для слияния и сравнения текстовых файлов\&. Она может сравнить произвольное число файлов в представлении бок о бок, предоставляет пользователям возможность вручную корректировать соответствие строк и редактировать файлы напрямую\&.
Diffuse Diffuse
может также извлекать ревизии файлов из Bazaar, CVS, Darcs, Git, Mercurial, Monotone, RCS, Subversion и SVK репозиториев для их сравнения и слияния\&. может также извлекать ревизии файлов из Bazaar, CVS, Darcs, Git, Mercurial, Monotone, RCS и Subversion репозиториев для их сравнения и слияния\&.
.SH "ОПЦИИ" .SH "ОПЦИИ"
.SS "Параметры Справки" .SS "Параметры Справки"
.PP .PP

View File

@ -18,7 +18,6 @@ src/diffuse/vcs/git.py
src/diffuse/vcs/hg.py src/diffuse/vcs/hg.py
src/diffuse/vcs/mtn.py src/diffuse/vcs/mtn.py
src/diffuse/vcs/rcs.py src/diffuse/vcs/rcs.py
src/diffuse/vcs/svk.py
src/diffuse/vcs/svn.py src/diffuse/vcs/svn.py
src/diffuse/vcs/vcs_interface.py src/diffuse/vcs/vcs_interface.py
src/diffuse/vcs/vcs_registry.py src/diffuse/vcs/vcs_registry.py

View File

@ -47,11 +47,6 @@ class Preferences:
# find available encodings # find available encodings
self.encodings: List[Optional[str]] = sorted(set(encodings.aliases.aliases.values())) 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'] auto_detect_codecs = ['utf_8', 'utf_16', 'latin_1']
e = utils.norm_encoding(sys.getfilesystemencoding()) e = utils.norm_encoding(sys.getfilesystemencoding())
if e is not None and e not in auto_detect_codecs: if e is not None and e not in auto_detect_codecs:
@ -154,14 +149,13 @@ class Preferences:
('hg', 'Mercurial', 'hg'), ('hg', 'Mercurial', 'hg'),
('mtn', 'Monotone', 'mtn'), ('mtn', 'Monotone', 'mtn'),
('rcs', 'RCS', None), ('rcs', 'RCS', None),
('svn', 'Subversion', 'svn'), ('svn', 'Subversion', 'svn')]
('svk', 'SVK', svk_bin)]
vcs_template = [ vcs_template = [
'List', [ 'List', [
'String', 'String',
'vcs_search_order', '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') _('Version control system search order')
] ]
] ]

View File

@ -1,64 +0,0 @@
# Diffuse: a graphical tool for merging and comparing text files.
#
# Copyright (C) 2019 Derrick Moser <derrick_moser@yahoo.com>
# Copyright (C) 2021 Romain Failliot <romain.failliot@foolstep.com>
#
# 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')

View File

@ -30,7 +30,6 @@ from diffuse.vcs.vcs_interface import VcsInterface
# Subversion support # Subversion support
# SVK support subclasses from this
class Svn(VcsInterface): class Svn(VcsInterface):
def __init__(self, root: str): def __init__(self, root: str):
super().__init__(root) super().__init__(root)

View File

@ -19,12 +19,10 @@
import os import os
from gettext import gettext as _
from typing import List, Optional from typing import List, Optional
from diffuse import utils from diffuse import utils
from diffuse.preferences import Preferences from diffuse.preferences import Preferences
from diffuse.vcs.folder_set import FolderSet
from diffuse.vcs.vcs_interface import VcsInterface from diffuse.vcs.vcs_interface import VcsInterface
from diffuse.vcs.bzr import Bzr from diffuse.vcs.bzr import Bzr
from diffuse.vcs.cvs import Cvs 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.hg import Hg
from diffuse.vcs.mtn import Mtn from diffuse.vcs.mtn import Mtn
from diffuse.vcs.rcs import Rcs from diffuse.vcs.rcs import Rcs
from diffuse.vcs.svk import Svk
from diffuse.vcs.svn import Svn from diffuse.vcs.svn import Svn
@ -48,7 +45,6 @@ class VcsRegistry:
'hg': _get_hg_repo, 'hg': _get_hg_repo,
'mtn': _get_mtn_repo, 'mtn': _get_mtn_repo,
'rcs': _get_rcs_repo, 'rcs': _get_rcs_repo,
'svk': _get_svk_repo,
'svn': _get_svn_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]: def _get_svn_repo(path: str, prefs: Preferences) -> Optional[VcsInterface]:
p = _find_parent_dir_with(path, '.svn') p = _find_parent_dir_with(path, '.svn')
return Svn(p) if p else None 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