From: kevan Date: Sat, 18 Jul 2009 03:00:10 +0000 (-0700) Subject: Add 'only_files' option to the overwrite field in Adder X-Git-Tag: allmydata-tahoe-1.5.0~38 X-Git-Url: https://git.rkrishnan.org/pf/content/%22news.html//%22%22?a=commitdiff_plain;h=c476c66b0ea37912968486318b4b5bd16d8123eb;p=tahoe-lafs%2Ftahoe-lafs.git Add 'only_files' option to the overwrite field in Adder --- diff --git a/src/allmydata/dirnode.py b/src/allmydata/dirnode.py index b06836f3..117c80e4 100644 --- a/src/allmydata/dirnode.py +++ b/src/allmydata/dirnode.py @@ -98,6 +98,9 @@ class Adder: if name in children: if not self.overwrite: raise ExistingChildError("child '%s' already exists" % name) + + if self.overwrite == "only_files" and IDirectoryNode.providedBy(children[name][0]): + raise ExistingChildError("child '%s' already exists" % name) metadata = children[name][1].copy() else: metadata = {"ctime": now,