Beispiel #1
0
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) )
Beispiel #2
0
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) )