repo = git.repo.Repo()
# reset local repository first
+ logger.debug('Reset and clean repository to HEAD first.')
gitcmd = git.Git('.')
- gitcmd.reset('HEAD')
+ logger.debug('%s' %(gitcmd.reset('--hard','HEAD')))
+ logger.debug('%s' %(gitcmd.clean('-fdx')))
#if GIT_BRANCH_NAME != 'master':
localname = GIT_BRANCH_NAME
- remotename = os.path.join('origin', GIT_BRANCH_NAME)
+ remotename = os.path.join('origin', GIT_BRANCH_NAME)
if not git_helper.git_new_branch_from(localname,remotename):
raise Exception('Checkout of %s was not successfull.' %( remotename ))
+ else:
+ logger.debug('Status is now:\n%s' %( gitcmd.status() ))
- # we need to make sure our jenkins config is used, so let's delete any
- # other config available in repository that might be prefered
+ # we need to make sure our jenkins config is used, so let's delete any
+ # other config available in repository that might be prefered
#cleanup_files = ('.gbp.conf', 'debian/gbp.conf', '.git/gbp.conf')
#result = git_helper.git_cleanup_branch(cleanup_files)
#commit_files = result["goods"].keys()
if (GIT_BRANCH_NAME == 'master' or GIT_BRANCH_NAME.startswith('hotfix/')) and not distribution in allowed_production_distros:
logger_error('Distribution %s in debian/changelog not listed in %s' % allowed_production_distros )
raise Exception(
- 'Distribution %s in debian/changelog not listed in %s' % allowed_production_distros
+ 'Distribution %s in debian/changelog not listed in %s' % allowed_production_distros
)
exit_error()
stderr=subprocess.STDOUT,
env={'':''}
)
-
+
logger.debug('Calling "%s" ..' %(' '.join(cmd)))
ret = cmdobj.wait()
for line in cmdobj.stdout.readlines():