mirror of
https://github.com/f-droid/fdroidserver.git
synced 2026-03-24 18:01:53 -04:00
Drop support for Mercurial (hg)
This commit is contained in:
committed by
Hans-Christoph Steiner
parent
01ca7db544
commit
ff135e132e
@@ -123,7 +123,6 @@ packages="
|
||||
fdroidserver
|
||||
git-svn
|
||||
gnupg
|
||||
mercurial
|
||||
patch
|
||||
python3-magic
|
||||
python3-packaging
|
||||
|
||||
@@ -152,8 +152,8 @@ def check_tags(app: metadata.App, pattern: str) -> tuple[str, int, str]:
|
||||
else:
|
||||
repotype = app.RepoType
|
||||
|
||||
if repotype not in ('git', 'git-svn', 'hg'):
|
||||
raise MetaDataException(_('Tags update mode only works for git, hg, bzr and git-svn repositories currently'))
|
||||
if repotype != "git":
|
||||
raise MetaDataException(_('Tags update mode only works for git repositories currently'))
|
||||
|
||||
if repotype == 'git-svn' and ';' not in app.Repo:
|
||||
raise MetaDataException(_('Tags update mode used in git-svn, but the repo was not set up with tags'))
|
||||
@@ -313,8 +313,6 @@ def check_repomanifest(app: metadata.App, branch: Optional[str] = None) -> tuple
|
||||
vcs.gotorevision(branch)
|
||||
elif repotype == 'git-svn':
|
||||
vcs.gotorevision(branch)
|
||||
elif repotype == 'hg':
|
||||
vcs.gotorevision(branch)
|
||||
|
||||
last_build = get_last_build_from_app(app)
|
||||
try_init_submodules(app, last_build, vcs)
|
||||
|
||||
@@ -1544,8 +1544,6 @@ def getvcs(vcstype, remote, local):
|
||||
)
|
||||
if vcstype == 'git-svn':
|
||||
return vcs_gitsvn(remote, local)
|
||||
if vcstype == 'hg':
|
||||
return vcs_hg(remote, local)
|
||||
if vcstype == 'srclib':
|
||||
if str(local) != os.path.join('build', 'srclib', str(remote)):
|
||||
raise VCSException("Error: srclib paths are hard-coded!")
|
||||
@@ -2032,45 +2030,6 @@ class vcs_gitsvn(vcs):
|
||||
return p.output.strip()
|
||||
|
||||
|
||||
class vcs_hg(vcs):
|
||||
|
||||
def repotype(self):
|
||||
return 'hg'
|
||||
|
||||
def clientversioncmd(self):
|
||||
return ['hg', '--version']
|
||||
|
||||
def gotorevisionx(self, rev):
|
||||
if not os.path.exists(self.local):
|
||||
p = FDroidPopen(['hg', 'clone', '--ssh', '/bin/false', '--', self.remote, str(self.local)],
|
||||
output=False)
|
||||
if p.returncode != 0:
|
||||
self.clone_failed = True
|
||||
raise VCSException("Hg clone failed", p.output)
|
||||
else:
|
||||
p = FDroidPopen(['hg', 'status', '-uiS'], cwd=self.local, output=False)
|
||||
if p.returncode != 0:
|
||||
raise VCSException("Hg status failed", p.output)
|
||||
for line in p.output.splitlines():
|
||||
if not line.startswith('? ') and not line.startswith('I '):
|
||||
raise VCSException("Unexpected output from hg status -uS: " + line)
|
||||
FDroidPopen(['rm', '-rf', '--', line[2:]], cwd=self.local, output=False)
|
||||
if not self.refreshed:
|
||||
p = FDroidPopen(['hg', 'pull', '--ssh', '/bin/false'], cwd=self.local, output=False)
|
||||
if p.returncode != 0:
|
||||
raise VCSException("Hg pull failed", p.output)
|
||||
self.refreshed = True
|
||||
|
||||
rev = rev or 'default'
|
||||
if not rev:
|
||||
return
|
||||
p = FDroidPopen(['hg', 'update', '-C', '--', rev], cwd=self.local, output=False)
|
||||
if p.returncode != 0:
|
||||
raise VCSException("Hg checkout of '%s' failed" % rev, p.output)
|
||||
|
||||
def _gettags(self):
|
||||
p = FDroidPopen(['hg', 'tags', '-q'], cwd=self.local, output=False)
|
||||
return p.output.splitlines()[1:]
|
||||
# fmt: on
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user