[Treepkg-commits] r134 - trunk/treepkg

scm-commit@wald.intevation.org scm-commit at wald.intevation.org
Thu Nov 6 16:59:50 CET 2008


Author: bh
Date: 2008-11-06 16:59:50 +0100 (Thu, 06 Nov 2008)
New Revision: 134

Modified:
   trunk/treepkg/subversion.py
Log:
Allow checkouts of specific revision and to prohibit recursion during
checkout and update


Modified: trunk/treepkg/subversion.py
===================================================================
--- trunk/treepkg/subversion.py	2008-11-06 15:36:29 UTC (rev 133)
+++ trunk/treepkg/subversion.py	2008-11-06 15:59:50 UTC (rev 134)
@@ -1,4 +1,4 @@
-# Copyright (C) 2007 by Intevation GmbH
+# Copyright (C) 2007, 2008 by Intevation GmbH
 # Authors:
 # Bernhard Herzog <bh at 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"""



More information about the Treepkg-commits mailing list