added svn commit logging
- added a new post-commit script - updated repo.sh to install this script in a svn repository.
This commit is contained in:
		| @ -1,7 +1,7 @@ | ||||
|  | ||||
| cfgdir=$(CFGDIR) | ||||
| cfg_DATA = codepot.ini codepot.sql codepot.a2ldap | ||||
| cfg_SCRIPTS = repo.sh start-commit | ||||
| cfg_SCRIPTS = repo.sh start-commit post-commit | ||||
|  | ||||
| EXTRA_DIST = $(cfg_DATA)  $(cfg_SCRIPTS) | ||||
|  | ||||
|  | ||||
| @ -166,7 +166,7 @@ top_builddir = @top_builddir@ | ||||
| top_srcdir = @top_srcdir@ | ||||
| wwwdir = @wwwdir@ | ||||
| cfg_DATA = codepot.ini codepot.sql codepot.a2ldap | ||||
| cfg_SCRIPTS = repo.sh start-commit | ||||
| cfg_SCRIPTS = repo.sh start-commit post-commit | ||||
| EXTRA_DIST = $(cfg_DATA)  $(cfg_SCRIPTS) | ||||
| all: all-am | ||||
|  | ||||
|  | ||||
| @ -75,10 +75,16 @@ sysadmin_userid = | ||||
| max_upload_size = "10000" | ||||
|  | ||||
| ;------------------------------------------------------------------------------ | ||||
| ; Maximum number of latest projects to show | ||||
| ; Maximum number of latest projects to show in the front page | ||||
| ;------------------------------------------------------------------------------ | ||||
| max_latest_projects = "10" | ||||
|  | ||||
| ;------------------------------------------------------------------------------ | ||||
| ; Maximum number of svn commits to show in the front page | ||||
| ;------------------------------------------------------------------------------ | ||||
| max_svn_commits = "10" | ||||
|  | ||||
|  | ||||
| ;------------------------------------------------------------------------------ | ||||
| ; directory to accomodate subversion repositories | ||||
| ;------------------------------------------------------------------------------ | ||||
|  | ||||
| @ -73,3 +73,10 @@ CREATE TABLE file ( | ||||
| 		ON DELETE RESTRICT ON UPDATE CASCADE | ||||
| ) charset=utf8 engine=InnoDB;	 | ||||
|  | ||||
| CREATE TABLE log  ( | ||||
| 	id         BIGINT PRIMARY KEY AUTO_INCREMENT, | ||||
| 	type       VARCHAR(16)  NOT NULL, | ||||
| 	message    TEXT         NOT NULL, | ||||
| 	createdon  DATETIME     NOT NULL, | ||||
| 	INDEX timed_type (createdon, type) | ||||
| ) charset=utf8 engine=InnoDB;	 | ||||
|  | ||||
							
								
								
									
										13
									
								
								codepot/etc/post-commit
									
									
									
									
									
										Executable file
									
								
							
							
						
						
									
										13
									
								
								codepot/etc/post-commit
									
									
									
									
									
										Executable file
									
								
							| @ -0,0 +1,13 @@ | ||||
| #!/bin/sh | ||||
|  | ||||
| post_commit() { | ||||
| 	local repo_path="$1" | ||||
| 	local rev="$2" | ||||
| 	local repo="`basename "${repo_path}"`" | ||||
|  | ||||
| 	ans="`wget -q -O- "%API%/logSvnCommit/${repo}/${rev}" 2>/dev/null`" | ||||
| 	return 0 | ||||
| } | ||||
|  | ||||
| post_commit "$1" "$2" | ||||
| exit $? | ||||
| @ -29,10 +29,19 @@ make_repo() { | ||||
| 		chmod 0755 "${repodir}/start-commit" | ||||
| 	#} | ||||
|  | ||||
| 	#[ -f "${repodir}/post-commit" ] || { | ||||
| 		sed "s|%API%|${api}|g" "${cfgdir}/post-commit" > "${repodir}/post-commit" || { | ||||
| 			echo "ERROR: cannot install post-commit to ${repodir}" | ||||
| 			return 1; | ||||
| 		} | ||||
| 		chmod 0755 "${repodir}/post-commit" | ||||
| 	#} | ||||
|  | ||||
| 	svnadmin create "${repodir}/${reponame}" && { | ||||
| 		oldpwd="`pwd`" | ||||
| 		cd "${repodir}/${reponame}/hooks" | ||||
| 		ln -sf ../../start-commit start-commit | ||||
| 		ln -sf ../../post-commit post-commit | ||||
| 		cd "${oldpwd}" | ||||
| 	} | ||||
|  | ||||
|  | ||||
		Reference in New Issue
	
	Block a user