Index: /trunk/puppet/modules/puppet-svn/.hg/branch
===================================================================
--- /trunk/puppet/modules/puppet-svn/.hg/branch	(revision 625)
+++ /trunk/puppet/modules/puppet-svn/.hg/branch	(revision 625)
@@ -0,0 +1,1 @@
+default
Index: /trunk/puppet/modules/puppet-svn/.hg/branch.cache
===================================================================
--- /trunk/puppet/modules/puppet-svn/.hg/branch.cache	(revision 625)
+++ /trunk/puppet/modules/puppet-svn/.hg/branch.cache	(revision 625)
@@ -0,0 +1,2 @@
+928c8adfd26b5944859fff2fcf2c917462723268 99
+928c8adfd26b5944859fff2fcf2c917462723268 default
Index: /trunk/puppet/modules/puppet-svn/.hg/hgrc
===================================================================
--- /trunk/puppet/modules/puppet-svn/.hg/hgrc	(revision 625)
+++ /trunk/puppet/modules/puppet-svn/.hg/hgrc	(revision 625)
@@ -0,0 +1,2 @@
+[paths]
+default = https://hg.koumbit.net/module-svn
Index: /trunk/puppet/modules/puppet-svn/.hg/requires
===================================================================
--- /trunk/puppet/modules/puppet-svn/.hg/requires	(revision 625)
+++ /trunk/puppet/modules/puppet-svn/.hg/requires	(revision 625)
@@ -0,0 +1,2 @@
+revlogv1
+store
Index: /trunk/puppet/modules/puppet-svn/.hg/undo.branch
===================================================================
--- /trunk/puppet/modules/puppet-svn/.hg/undo.branch	(revision 625)
+++ /trunk/puppet/modules/puppet-svn/.hg/undo.branch	(revision 625)
@@ -0,0 +1,1 @@
+default
Index: /trunk/puppet/modules/puppet-svn/LICENSE
===================================================================
--- /trunk/puppet/modules/puppet-svn/LICENSE	(revision 625)
+++ /trunk/puppet/modules/puppet-svn/LICENSE	(revision 625)
@@ -0,0 +1,29 @@
+These files were written by Antoine Beaupre and others as noted in the
+individual files.
+
+Copyright (C) 2007 Micah Anderson
+All rights reserved.
+
+Redistribution and use in source and binary forms, with or without
+modification, are permitted provided that the following conditions
+are met:
+1. Redistributions of source code must retain the above copyright
+   notice, this list of conditions and the following disclaimer.
+2. Redistributions in binary form must reproduce the above copyright
+   notice, this list of conditions and the following disclaimer in the
+   documentation and/or other materials provided with the distribution.
+3. Neither the name of the Author nor the names of its contributors
+   may be used to endorse or promote products derived from this software
+   without specific prior written permission.
+
+THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND
+ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ARE DISCLAIMED.  IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
+FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
+DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
+OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
+HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
+LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
+OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
+SUCH DAMAGE.
Index: /trunk/puppet/modules/puppet-svn/manifests/README
===================================================================
--- /trunk/puppet/modules/puppet-svn/manifests/README	(revision 625)
+++ /trunk/puppet/modules/puppet-svn/manifests/README	(revision 625)
@@ -0,0 +1,7 @@
+This is a module to manage Subversion checkouts. It can keep in sync
+an existing checkout and clone new ones. It can also initialize repos.
+
+See the manifest files for more information.
+
+This module was written by Micah Anderson, after heavy modifications
+of David Schmitt module.
Index: /trunk/puppet/modules/puppet-svn/manifests/checkout.pp
===================================================================
--- /trunk/puppet/modules/puppet-svn/manifests/checkout.pp	(revision 625)
+++ /trunk/puppet/modules/puppet-svn/manifests/checkout.pp	(revision 625)
@@ -0,0 +1,49 @@
+# Serve subversion-based code from a local location.  The job of this
+# module is to check the data out from subversion and keep it up to
+# date
+#
+# Example usage:
+#   svn::checkout { dist:
+#       repository => "https://reductivelabs.com/svn",
+#       svnparms = "--someparameter=AAAA --other parameter",
+#       local_path => "/dist",
+#       local_name => "mycheckout" 
+#       user => "puppet",
+#       password => "mypassword"
+#   }
+define svn::checkout($repository, $local_path, $local_name = false, $user = false, $password = false) {
+
+  include svn
+
+  $local_name_real = $local_name ? { false => $name, default => $local_name }
+
+#   package { ["subversion"]: ensure => installed }
+
+#  file { $local_path:
+#    ensure => directory,
+#    owner => root,
+#    group => root
+#  }
+
+  $svnparms = $user ? {
+    false   => "--non-interactive",
+    default => "--non-interactive --username '$user' --password '$password'",
+  }
+
+  $svncmd = "/usr/bin/svn $svnparms"
+  
+  exec { "svn_co_$name":
+    command => "$svncmd checkout '$repository' '$local_name_real'",
+    cwd => $local_path,
+    creates => "$local_path/$local_name_real/.svn",
+#    require => Package ["subversion"],
+#    package { "subversion": ensure => installed }
+  }
+
+  exec { "svn_update_$name":
+    command => "$svncmd update '$local_name_real'",
+    cwd => $local_path,
+    require => Exec["svn_co_$name"],
+    onlyif => "$svncmd status -u '$local_name_real' | /bin/grep -E \"\*|\!\"",
+  }
+}
Index: /trunk/puppet/modules/puppet-svn/manifests/init.pp
===================================================================
--- /trunk/puppet/modules/puppet-svn/manifests/init.pp	(revision 625)
+++ /trunk/puppet/modules/puppet-svn/manifests/init.pp	(revision 625)
@@ -0,0 +1,16 @@
+#
+# Example usage:
+# The following creates the repository at /var/lib/svn/puppet
+#
+# svnrepo { puppet: path => "/var/lib/svn" }
+#
+# The following checks out the repository at /var/lib/puppet
+#
+# svnserve { puppet: source => "file:///var/lib/svn", path => "/var/lib/puppet" }
+
+class svn {
+  package { "subversion": ensure => installed }
+}
+
+import 'checkout.pp'
+import 'repo.pp'
Index: /trunk/puppet/modules/puppet-svn/manifests/repo.pp
===================================================================
--- /trunk/puppet/modules/puppet-svn/manifests/repo.pp	(revision 625)
+++ /trunk/puppet/modules/puppet-svn/manifests/repo.pp	(revision 625)
@@ -0,0 +1,11 @@
+# Create a new subversion repository.
+
+define svn::repo($path) {
+
+  exec { "svnadmin create ${name}":
+    command => "/usr/bin/svnadmin create $path/$name",
+    creates => "$path/$name",
+    require => Package ["subversion"],  
+  }
+
+}
