Skip to content

Commit

Permalink
enable specific version for stack_of_remote_repository
Browse files Browse the repository at this point in the history
  • Loading branch information
dirk-thomas committed Aug 28, 2012
1 parent 7eab085 commit 74729f6
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions src/buildfarm/stack_of_remote_repository.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
import tempfile
import vcstools

def get_stack_of_remote_repository(name, type, url, workspace=None):
def get_stack_of_remote_repository(name, type, url, workspace=None, version=None):
if workspace is None:
workspace = tempfile.mkdtemp()
if not os.path.isdir(workspace):
Expand All @@ -20,12 +20,12 @@ def get_stack_of_remote_repository(name, type, url, workspace=None):
client = vcstools.VcsClient(type, workdir)
if client.path_exists():
if client.get_url() == url:
client.update('')
client.update(version if version is not None else '')
else:
shutil.rmtree(workdir)
client.checkout(url, shallow=True)
client.checkout(url, version=version if version is not None else '', shallow=True)
else:
client.checkout(url, shallow=True)
client.checkout(url, version=version if version is not None else '', shallow=True)

# parse stack.xml
stack_xml_path = os.path.join(workdir, 'stack.xml')
Expand Down

0 comments on commit 74729f6

Please sign in to comment.