[Treepkg-commits] r156 - trunk/treepkg
scm-commit@wald.intevation.org
scm-commit at wald.intevation.org
Tue Jan 13 15:21:38 CET 2009
Author: bh
Date: 2009-01-13 15:21:37 +0100 (Tue, 13 Jan 2009)
New Revision: 156
Modified:
trunk/treepkg/subversion.py
Log:
Add treepkg.subversion.ManualWorkingCopy. Same interface as
SvnWorkingCopy, but for code not under actual version control.
Modified: trunk/treepkg/subversion.py
===================================================================
--- trunk/treepkg/subversion.py 2009-01-13 13:48:59 UTC (rev 155)
+++ trunk/treepkg/subversion.py 2009-01-13 14:21:37 UTC (rev 156)
@@ -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
More information about the Treepkg-commits
mailing list