[SCM] build.samba.org - branch master updated
Jelmer Vernooij
jelmer at samba.org
Sat Nov 13 06:21:47 MST 2010
The branch, master has been updated
via 7fd815d fix git root.
from 1d36022 Kill a global.
http://gitweb.samba.org/?p=build-farm.git;a=shortlog;h=master
- Log -----------------------------------------------------------------
commit 7fd815d0a196ed363342b2aa77707b6863c825d7
Author: Jelmer Vernooij <jelmer at samba.org>
Date: Sat Nov 13 14:21:40 2010 +0100
fix git root.
-----------------------------------------------------------------------
Summary of changes:
buildfarm/__init__.py | 9 +++++++--
buildfarm/history.py | 16 ++++++++++++----
2 files changed, 19 insertions(+), 6 deletions(-)
Changeset truncated at 500 lines:
diff --git a/buildfarm/__init__.py b/buildfarm/__init__.py
index ba87fb1..76a4146 100644
--- a/buildfarm/__init__.py
+++ b/buildfarm/__init__.py
@@ -21,6 +21,8 @@ import ConfigParser
import os
import re
+GIT_ROOT = "/data/git"
+
class Tree(object):
"""A tree to build."""
@@ -35,8 +37,11 @@ class Tree(object):
self.scm = scm
def get_branch(self):
- from buildfarm.history import GitBranch
- return GitBranch(self.repo, self.branch)
+ if self.scm == "git":
+ from buildfarm.history import GitBranch
+ return GitBranch(os.path.join(GIT_ROOT, self.repo), self.branch)
+ else:
+ raise NotImplementedError(self.scm)
def __repr__(self):
return "<%s %r>" % (self.__class__.__name__, self.name)
diff --git a/buildfarm/history.py b/buildfarm/history.py
index d52bec1..ffe392f 100644
--- a/buildfarm/history.py
+++ b/buildfarm/history.py
@@ -27,8 +27,11 @@ from dulwich.repo import Repo
class Branch(object):
+ """A version control branch."""
def authors(self):
+ """Determine all authors that have contributed to this project.
+ """
ret = set()
for rev in self.log():
ret.add(rev.author)
@@ -43,7 +46,8 @@ class Branch(object):
class Revision(object):
- def __init__(self, revision, date, author, message, modified=[], added=[], removed=[]):
+ def __init__(self, revision, date, author, message, modified=[], added=[],
+ removed=[]):
self.revision = revision
self.date = date
self.author = author
@@ -78,7 +82,9 @@ class GitBranch(object):
removed.add(oldpath)
else:
modified.add(newpath)
- return Revision(commit.id, commit.commit_time, commit.author, commit.message, modified=modified, removed=removed, added=added)
+ return Revision(commit.id, commit.commit_time, commit.author,
+ commit.message, modified=modified, removed=removed,
+ added=added)
def log(self, from_rev=None, exclude_revs=None):
if from_rev is None:
@@ -105,6 +111,8 @@ class GitBranch(object):
def diff(self, revision):
commit = self.repo[revision]
f = StringIO()
- for (oldpath, newpath), (oldmode, newmode), (oldsha, newsha) in self._changes_for(commit):
- write_blob_diff(f, (oldpath, oldmode, self.store[oldsha]), (newpath, newmode, self.store[newsha]))
+ changes = self._changes_for(commit)
+ for (oldpath, newpath), (oldmode, newmode), (oldsha, newsha) in changes:
+ write_blob_diff(f, (oldpath, oldmode, self.store[oldsha]),
+ (newpath, newmode, self.store[newsha]))
return (self._revision_from_commit(commit), f.getvalue())
--
build.samba.org
More information about the samba-cvs
mailing list