# HG changeset patch # User Bernhard Herzog # Date 1231856497 0 # Node ID e387b879fd384345ebc84cab516f682d5c320627 # Parent 653a45adda50ef4790dd51c30cf704a2ab675abb Add treepkg.subversion.ManualWorkingCopy. Same interface as SvnWorkingCopy, but for code not under actual version control. diff -r 653a45adda50 -r e387b879fd38 treepkg/subversion.py --- 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