1
0
mirror of https://gitlab.com/fdroid/fdroidserver.git synced 2024-11-09 17:00:12 +01:00

Drop svn support in favour of git-svn

Reasons:

* Cloning a svn repo via svn doesn't fetch the entire history
* Svn checkout is incredibly slow
* Svn doesn't have important features such as a 'clean' command

The only reason why we kept svn was for anonymous logins to repositories. This
is no longer a reason since git-svn also supports them.
This commit is contained in:
Daniel Martí 2014-07-18 12:39:24 +02:00
parent 13987b5c77
commit 78ff22d952
4 changed files with 6 additions and 56 deletions

View File

@ -191,8 +191,6 @@ def check_repomanifest(app, branch=None):
vcs.gotorevision(branch) vcs.gotorevision(branch)
elif repotype == 'git-svn': elif repotype == 'git-svn':
vcs.gotorevision(branch) vcs.gotorevision(branch)
elif repotype == 'svn':
vcs.gotorevision(None)
elif repotype == 'hg': elif repotype == 'hg':
vcs.gotorevision(branch) vcs.gotorevision(branch)
elif repotype == 'bzr': elif repotype == 'bzr':
@ -250,8 +248,8 @@ def check_repotrunk(app, branch=None):
build_dir = os.path.join('build/', app['id']) build_dir = os.path.join('build/', app['id'])
repotype = app['Repo Type'] repotype = app['Repo Type']
if repotype not in ('svn', 'git-svn'): if repotype not in ('git-svn', ):
return (None, 'RepoTrunk update mode only makes sense in svn and git-svn repositories') return (None, 'RepoTrunk update mode only makes sense in git-svn repositories')
# Set up vcs interface and make sure we have the latest code... # Set up vcs interface and make sure we have the latest code...
vcs = common.getvcs(app['Repo Type'], app['Repo'], build_dir) vcs = common.getvcs(app['Repo Type'], app['Repo'], build_dir)

View File

@ -353,8 +353,6 @@ def getcvname(app):
def getvcs(vcstype, remote, local): def getvcs(vcstype, remote, local):
if vcstype == 'git': if vcstype == 'git':
return vcs_git(remote, local) return vcs_git(remote, local)
if vcstype == 'svn':
return vcs_svn(remote, local)
if vcstype == 'git-svn': if vcstype == 'git-svn':
return vcs_gitsvn(remote, local) return vcs_gitsvn(remote, local)
if vcstype == 'hg': if vcstype == 'hg':
@ -365,6 +363,8 @@ def getvcs(vcstype, remote, local):
if local != os.path.join('build', 'srclib', remote): if local != os.path.join('build', 'srclib', remote):
raise VCSException("Error: srclib paths are hard-coded!") raise VCSException("Error: srclib paths are hard-coded!")
return getsrclib(remote, os.path.join('build', 'srclib'), raw=True) return getsrclib(remote, os.path.join('build', 'srclib'), raw=True)
if vcstype == 'svn':
raise VCSException("Deprecated vcs type 'svn' - please use 'git-svn' instead")
raise VCSException("Invalid vcs type " + vcstype) raise VCSException("Invalid vcs type " + vcstype)
@ -379,7 +379,7 @@ class vcs:
# svn, git-svn and bzr may require auth # svn, git-svn and bzr may require auth
self.username = None self.username = None
if self.repotype() in ('svn', 'git-svn', 'bzr'): if self.repotype() in ('git-svn', 'bzr'):
if '@' in remote: if '@' in remote:
self.username, remote = remote.split('@') self.username, remote = remote.split('@')
if ':' not in self.username: if ':' not in self.username:
@ -713,50 +713,6 @@ class vcs_gitsvn(vcs):
return p.output.strip() return p.output.strip()
class vcs_svn(vcs):
def repotype(self):
return 'svn'
def userargs(self):
if self.username is None:
return ['--non-interactive']
return ['--username', self.username,
'--password', self.password,
'--non-interactive']
def gotorevisionx(self, rev):
if not os.path.exists(self.local):
p = SilentPopen(['svn', 'checkout', self.remote, self.local] + self.userargs())
if p.returncode != 0:
self.clone_failed = True
raise VCSException("Svn checkout of '%s' failed" % rev, p.output)
else:
for svncommand in (
'svn revert -R .',
r"svn status | awk '/\?/ {print $2}' | xargs rm -rf"):
p = SilentPopen([svncommand], cwd=self.local, shell=True)
if p.returncode != 0:
raise VCSException("Svn reset ({0}) failed in {1}".format(svncommand, self.local), p.output)
if not self.refreshed:
p = SilentPopen(['svn', 'update'] + self.userargs(), cwd=self.local)
if p.returncode != 0:
raise VCSException("Svn update failed", p.output)
self.refreshed = True
revargs = list(['-r', rev] if rev else [])
p = SilentPopen(['svn', 'update', '--force'] + revargs + self.userargs(), cwd=self.local)
if p.returncode != 0:
raise VCSException("Svn update failed", p.output)
def getref(self):
p = SilentPopen(['svn', 'info'], cwd=self.local)
for line in p.output.splitlines():
if line and line.startswith('Last Changed Rev: '):
return line[18:]
return None
class vcs_hg(vcs): class vcs_hg(vcs):
def repotype(self): def repotype(self):

View File

@ -235,7 +235,7 @@ def main():
if ref.startswith(s): if ref.startswith(s):
warn("Branch '%s' used as commit in srclib '%s'" % ( warn("Branch '%s' used as commit in srclib '%s'" % (
s, srclib)) s, srclib))
for s in ['git clone', 'svn checkout', 'svn co', 'hg clone']: for s in ['git clone', 'git svn clone', 'svn checkout', 'svn co', 'hg clone']:
for flag in ['init', 'prebuild', 'build']: for flag in ['init', 'prebuild', 'build']:
if not build[flag]: if not build[flag]:
continue continue

View File

@ -40,8 +40,6 @@ def main():
help="Spew out even more information than normal") help="Spew out even more information than normal")
parser.add_option("-q", "--quiet", action="store_true", default=False, parser.add_option("-q", "--quiet", action="store_true", default=False,
help="Restrict output to warnings and errors") help="Restrict output to warnings and errors")
parser.add_option("--nosvn", action="store_true", default=False,
help="Skip svn repositories - for test purposes, because they are too slow.")
(options, args) = parser.parse_args() (options, args) = parser.parse_args()
config = common.read_config(options) config = common.read_config(options)
@ -67,8 +65,6 @@ def main():
if not app['builds']: if not app['builds']:
logging.info("Skipping %s: no builds specified" % app['id']) logging.info("Skipping %s: no builds specified" % app['id'])
continue continue
elif options.nosvn and app['Repo Type'] == 'svn':
continue
logging.info("Processing " + app['id']) logging.info("Processing " + app['id'])