Mercurial > treepkg
changeset 208:1527c37bd7aa
Allow checkouts of specific revision and to prohibit recursion during
checkout and update
author | Bernhard Herzog <bh@intevation.de> |
---|---|
date | Thu, 06 Nov 2008 15:59:50 +0000 |
parents | b82fe4d25893 |
children | cbcd8f549ff7 |
files | treepkg/subversion.py |
diffstat | 1 files changed, 14 insertions(+), 8 deletions(-) [+] |
line wrap: on
line diff
--- a/treepkg/subversion.py Thu Nov 06 15:36:29 2008 +0000 +++ b/treepkg/subversion.py Thu Nov 06 15:59:50 2008 +0000 @@ -1,4 +1,4 @@ -# Copyright (C) 2007 by Intevation GmbH +# Copyright (C) 2007, 2008 by Intevation GmbH # Authors: # Bernhard Herzog <bh@intevation.de> # @@ -14,20 +14,26 @@ from util import extract_value_for_key -def checkout(url, localdir): +def checkout(url, localdir, revision=None, recurse=True): """Runs svn to checkout the repository at url into the localdir""" - run.call(cmdexpand("svn checkout -q $url $localdir", **locals())) + args = [] + if revision: + args.extend(["--revision", revision]) + if not recurse: + args.append("-N") + run.call(cmdexpand("svn checkout -q @args $url $localdir", **locals())) -def update(localdir, revision=None): +def update(localdir, revision=None, recurse=True): """Runs svn update on the localdir. The parameter revision, if given, is passed to svn as the value of the --revision option. """ + args = [] if revision: - revision = ["--revision", revision] - else: - revision = [] - run.call(cmdexpand("svn update -q @revision $localdir", **locals())) + args.extend(["--revision", revision]) + if not recurse: + args.append("-N") + run.call(cmdexpand("svn update -q @args $localdir", **locals())) def export(src, dest): """Runs svn export src dest"""