gitclone: don't do anything at update() if develop=true.

parent 7b1548ea
...@@ -242,27 +242,21 @@ class Recipe(object): ...@@ -242,27 +242,21 @@ class Recipe(object):
If user doesn't develop, reset to remote revision (or branch if revision is If user doesn't develop, reset to remote revision (or branch if revision is
not specified). not specified).
""" """
try: if self.develop:
# first cleanup pyc files return
self.deletePycFiles(self.location)
# then update # first cleanup pyc files
check_call([self.git_command, 'fetch', '--all'], cwd=self.location) self.deletePycFiles(self.location)
# If develop parameter is set, don't reset/update. # then update
# Otherwise, reset --hard check_call([self.git_command, 'fetch', '--all'], cwd=self.location)
if not self.develop:
if self.revision: # If develop parameter is set, don't reset/update.
self.gitReset(self.revision) # Otherwise, reset --hard
else: if self.revision:
self.gitReset('@{upstream}') self.gitReset(self.revision)
except: else:
if not self.develop: self.gitReset('@{upstream}')
raise
# Buildout will remove the installed location and mark the part as not
# installed if an error occurs during update. If we are developping this
# repository we do not want this to happen.
print 'Unable to update:\n%s' % traceback.format_exc()
def uninstall(name, options): def uninstall(name, options):
"""Keep the working copy, unless develop is set to false. """Keep the working copy, unless develop is set to false.
......
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