예제 #1
0
파일: svn.py 프로젝트: openengsb-attic/gsvn
def addFile( status, username, password, file ):
	"""Add file to svn working copy. """

	# we need to escape whitespace in file names for the shell
	file = file.replace(' ',  '\ ')
	file = file.replace('\t', '\\t')
	file = file.replace('\n', '\\n')

	if status[0] == '?':
		checkedCall( "svn add %s %s" % (_usernameAndPasswordToString( username, password ), file) )
예제 #2
0
파일: svn.py 프로젝트: openengsb-attic/gsvn
def commitToRepo( folder, username=None, password=None ):
	"""Commits everything in folder to its repo. Files that are new are added.
       If username or password are present they will be used in the svn requests.
       Files with conflicts will not be added."""

	output = checkedCall( "svn status %s %s" % (_usernameAndPasswordToString( username, password ),folder) )

	for line in output.splitlines():
		checkAndAdd( username, password, line )

	# commit changes
	checkedCall( "svn commit %s %s -m 'automatic commit by gsvn tool'" % (_usernameAndPasswordToString( username, password ),folder) )