Commit 3ffdd641 authored by Vincent Pelletier's avatar Vincent Pelletier Committed by Julien Muchembled

gitclone: Assume unclean on uninstall when git-executable cannot be found

parent 34fc3e01
...@@ -293,7 +293,9 @@ def uninstall(name, options): ...@@ -293,7 +293,9 @@ def uninstall(name, options):
return return
force_keep = False force_keep = False
if options.get('develop', 'yes').lower() in TRUE_VALUES: if options.get('develop', 'yes').lower() in TRUE_VALUES:
p = subprocess.Popen([options.get('git-executable', 'git'), 'status', '--short'], git_path = options.get('git-executable', 'git')
if not os.path.isabs(git_path) or os.path.exists(git_path):
p = subprocess.Popen([git_path, 'status', '--short'],
cwd=options['location'], cwd=options['location'],
stdout=subprocess.PIPE) stdout=subprocess.PIPE)
if p.communicate()[0].strip(): if p.communicate()[0].strip():
...@@ -301,7 +303,7 @@ def uninstall(name, options): ...@@ -301,7 +303,7 @@ def uninstall(name, options):
"This folder will be left as is." % options['location'] "This folder will be left as is." % options['location']
force_keep = True force_keep = True
p = subprocess.Popen([options.get('git-executable', 'git'), p = subprocess.Popen([git_path,
'log', '--branches', '--not', '--remotes'], 'log', '--branches', '--not', '--remotes'],
cwd=options['location'], cwd=options['location'],
stdout=subprocess.PIPE) stdout=subprocess.PIPE)
...@@ -309,6 +311,10 @@ def uninstall(name, options): ...@@ -309,6 +311,10 @@ def uninstall(name, options):
print "You have commits not pushed upstream in %s. "\ print "You have commits not pushed upstream in %s. "\
"This folder will be left as is." % options['location'] "This folder will be left as is." % options['location']
force_keep = True force_keep = True
else:
print "Cannot check if there are unpushed/uncommitted changes in %s. "\
"This folder will be left as is." % options['location']
force_keep = True
if force_keep: if force_keep:
# Eventhough this behaviour is not documented, buildout won't uninstall # Eventhough this behaviour is not documented, buildout won't uninstall
......
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