changeset 230:e387b879fd38

Add treepkg.subversion.ManualWorkingCopy. Same interface as SvnWorkingCopy, but for code not under actual version control.
author Bernhard Herzog <bh@intevation.de>
date Tue, 13 Jan 2009 14:21:37 +0000
parents 653a45adda50
children 7dbf0a3443bb
files treepkg/subversion.py
diffstat 1 files changed, 21 insertions(+), 0 deletions(-) [+]
line wrap: on
line diff
--- a/treepkg/subversion.py	Tue Jan 13 13:48:59 2009 +0000
+++ b/treepkg/subversion.py	Tue Jan 13 14:21:37 2009 +0000
@@ -8,6 +8,7 @@
 """Collection of subversion utility code"""
 
 import os
+import shutil
 
 import run
 from cmdexpand import cmdexpand
@@ -126,3 +127,23 @@
     def last_changed_revision(self):
         """Returns the last changed rev of the working copy"""
         return self.repository.last_changed_revision(self.localdir)
+
+
+class ManualWorkingCopy(object):
+
+    """A manually managed working copy"""
+
+    def __init__(self, directory):
+        self.directory = directory
+
+    def update_or_checkout(self, revision=None, recurse=True):
+        """This method does nothing"""
+        pass
+
+    def export(self, destdir):
+        """Copies the entire working copy to destdir"""
+        shutil.copytree(self.directory, destdir)
+
+    def last_changed_revision(self):
+        """Always returns 0"""
+        return 0
This site is hosted by Intevation GmbH (Datenschutzerklärung und Impressum | Privacy Policy and Imprint)