Commit 9dcf201f authored by Jérome Perrin's avatar Jérome Perrin

gitclone: keep repository content if they have local changes unless develop is set to false

By default we do not want to risk destroying developer's work.
parent 7475c7cb
......@@ -139,8 +139,10 @@ class Recipe(object):
if self.git_command == '':
self.git_command = 'git'
# Set boolean values
for key in ('develop', 'use-cache', 'ignore-ssl-certificate'):
setattr(self, key.replace('-', '_'), options.get(key) in TRUE_VALUES)
for key in ('use-cache', 'ignore-ssl-certificate'):
setattr(self, key.replace('-', '_'), options.get(key, '').lower() in TRUE_VALUES)
# By default we want to keep the repository
self.develop = options.get(key, 'yes').lower() in TRUE_VALUES
self.networkcache = buildout.get('networkcache', {})
......@@ -255,10 +257,10 @@ class Recipe(object):
self.gitReset('@{upstream}')
def uninstall(name, options):
"""Keep the working copy if develop is set to true.
"""Keep the working copy, unless develop is set to false.
"""
force_keep = False
if options.get('develop', 'no').lower() in ('1', 'yes', 'true'):
if options.get('develop', 'yes').lower() in TRUE_VALUES:
p = subprocess.Popen([options.get('git-executable', 'git'), 'status', '--short'],
cwd=options['location'],
stdout=subprocess.PIPE)
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment