Commit 621992b1 authored by bescoto's avatar bescoto

delete empty increments directories when removing older than


git-svn-id: http://svn.savannah.nongnu.org/svn/rdiff-backup@685 2b77aa54-bcbc-44c9-a7ec-4f6cf2b41109
parent dd6db0db
......@@ -7,6 +7,8 @@ rdiff-backup should now give a clean error message (no stack traces!)
when aborted with control-C, killed with a signal, or when the
connection is lost.
When removing older than, delete empty increments directories
New in v1.1.2 (2005/11/06)
--------------------------
......
......@@ -685,8 +685,8 @@ def RemoveOlderThan(rootrp):
def rot_require_rbdir_base(rootrp):
"""Make sure pointing to base of rdiff-backup dir"""
if restore_index != ():
Log.FatalError("Increments for directory %s cannot be removed separately.\n"
"Instead run on entire directory %s." %
Log.FatalError("Increments for directory %s cannot be removed "
"separately.\nInstead run on entire directory %s." %
(rootrp.path, restore_root.path))
......
......@@ -88,11 +88,11 @@ def delete_earlier_than_local(baserp, time):
"""Like delete_earlier_than, but run on local connection for speed"""
assert baserp.conn is Globals.local_connection
def yield_files(rp):
yield rp
if rp.isdir():
for filename in rp.listdir():
for sub_rp in yield_files(rp.append(filename)):
yield sub_rp
yield rp
for rp in yield_files(baserp):
if ((rp.isincfile() and rp.getinctime() < time) or
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment