The branch, master has been updated via 3da72d3 Remove svn/cvs support. from 4bb4b4c Force to have a ldb backend for make test
http://gitweb.samba.org/?p=build-farm.git;a=shortlog;h=master - Log ----------------------------------------------------------------- commit 3da72d3597747ff3a2a493df9871c37b0f37876c Author: Jelmer Vernooij <jel...@samba.org> Date: Tue Nov 9 08:32:23 2010 +0100 Remove svn/cvs support. ----------------------------------------------------------------------- Summary of changes: buildfarm/history.py | 96 ++------------------------------------------------ web/build.py | 11 ++---- 2 files changed, 6 insertions(+), 101 deletions(-) Changeset truncated at 500 lines: diff --git a/buildfarm/history.py b/buildfarm/history.py index 9a074fe..51e35f4 100644 --- a/buildfarm/history.py +++ b/buildfarm/history.py @@ -1,5 +1,5 @@ #!/usr/bin/python -# script to show recent checkins in cvs / svn / git +# script to show recent checkins in git # # Copyright (C) Andrew Tridgell <tri...@samba.org> 2001 # Copyright (C) Martin Pool <m...@samba.org> 2003 @@ -24,7 +24,6 @@ from buildfarm import util import commands import os -import time BASEDIR = "/home/build/master" HISTORYDIR = "/home/build/master/cache" @@ -41,104 +40,15 @@ class History(object): return util.LoadStructure(os.path.join(HISTORYDIR, "history.%s" % tree)) def diff(self, author, date, tree, revision): - """get recent cvs/svn entries""" + """get recent git entries""" # validate the tree t = self.db.trees[tree] - if t.scm == "cvs": - self._cvs_diff(t, author, date, tree) - elif t.scm == "svn": - self._svn_diff(t, revision, tree) - elif t.scm == "git": + if t.scm == "git": self._git_diff(t, revision, tree) else: raise Exception("Unknown VCS %s" % t.scm) - def _svn_diff(self, t, revision, tree): - """show recent svn entries""" - - os.chdir(os.path.join(UNPACKED_DIR, tree)) - - # determine the most recent version known to this database - for l in commands.getoutput("svn info").splitlines(): - if l.startswith("Revision"): - current_revision = l.strip().split(":") - break - else: - raise Exception("Unable to find current revision") - - if (not revision.isdigit() or int(revision) < 0 or - int(revision) > int(current_revision)): - raise Exception("unknown revision[%s]" % revision) - - log = self._log(tree) - - # backwards? why? well, usually our users are looking for the newest - # stuff, so it's most likely to be found sooner - for i in range(len(log), 0, -1): - if log[i]["REVISION"] == revision: - entry = log[i] - break - else: - raise Exception("Unable to locate commit information revision[%s]." % revision) - - # get information about the current diff - title = "SVN Diff in %s:%s for revision r%s" % ( - tree, t.branch, revision) - - old_revision = revision - 1 - cmd = "svn diff -r %s:%s" % (old_revision, revision) - - return (title, entry, tree, [(cmd, commands.getoutput("%s 2> /dev/null" % cmd))]) - - def _cvs_diff(self, t, author, date, tree): - """show recent cvs entries""" - os.chdir(os.path.join(UNPACKED_DIR, tree)) - - log = self._log(tree) - - # for paranoia, check that the date string is a valid date - if not date[0].isdigit(): - raise Exception("unknown date") - - for i in range(log): - if author == log[i]["AUTHOR"] and date == log[i]["DATE"]: - entry = log[i] - break - else: - raise Exception("Unable to locate commit information author[%s] data[%s]." % ( - author, date)) - - t1 = time.ctime(date-60+(TIMEOFFSET*60*60)).strip() - t2 = time.ctime(date+60+(TIMEOFFSET*60*60)).strip() - - title = "CVS Diff in %s:%s for %s" % (tree, t.branch, t1) - - if entry["TAG"] != "" and entry["REVISIONS"] != "": - raise Exception("sorry, cvs diff on branches not currently possible due to a limitation in cvs") - - os.environ['CVS_PASSFILE'] = os.path.join(BASEDIR, ".cvspass") - - if entry["REVISIONS"]: - diffs = [] - for f in entry["REVISIONS"].keys(): - if entry["REVISIONS"][f]["REV1"] == "NONE": - cmd = "cvs rdiff -u -r 0 -r %s %s" % (entry["REVISIONS"][f]["REV2"], f) - elif entry["REVISIONS"][f]["REV2"] == "NONE": - cmd = "cvs rdiff -u -r %s -r 0 %s" % ( - entry["REVISIONS"][f]["REV1"], f) - else: - cmd = "cvs diff -b -u -r %s -r %s %s" % ( - entry["REVISIONS"][f]["REV1"], entry["REVISIONS"][f]["REV2"], f) - - diffs.append((cmd, commands.getoutput("%s 2> /dev/null" % cmd))) - else: - cmd = "cvs diff -b -u -D \"%s %s\" -D \"%s %s\" %s" % ( - t1, TIMEZONE, t2, TIMEZONE, entry["FILES"]) - - diffs = [(cmd, commands.getoutput("%s 2> /dev/null" % cmd))] - return (title, entry, tree, diffs) - def _git_diff(self, t, revision, tree): """show recent git entries""" os.chdir(os.path.join(UNPACKED_DIR, tree)) diff --git a/web/build.py b/web/build.py index 0ef018c..31e96a0 100755 --- a/web/build.py +++ b/web/build.py @@ -55,8 +55,6 @@ hosts = dict([(str(host.name), host) for host in hostsdb.hosts()]) trees = db.trees OLDAGE = db.OLDAGE -CVSWEB_BASE = "http://pserver.samba.org/cgi-bin/cvsweb" -VIEWCVS_BASE = "http://websvn.samba.org/cgi-bin/viewcvs.cgi" UNPACKED_BASE = "http://svn.samba.org/ftp/unpacked" GITWEB_BASE = "http://gitweb.samba.org" @@ -782,7 +780,8 @@ def main_menu(): def diff_pretty(diff): - """pretty up a cvs diff -u""" + """pretty up a diff -u""" + # FIXME: JRV 20101109 Use pygments for this ret = "" lines = diff.splitlines() @@ -812,11 +811,7 @@ def web_paths(t, paths): fmt = None - if t.scm == "cvs": - fmt = " <a href=\"%s/%s/%%s\">%%s</a>" % (CVSWEB_BASE, t.repo) - elif t.scm == "svn": - fmt = " <a href=\"%s/%s/%%s?root=%s\">%%s</a>" % (VIEWCVS_BASE, t.branch, t.repo) - elif t.scm == "git": + if t.scm == "git": r = t.repo s = t.subdir b = t.branch -- build.samba.org