Commit beaecda9 authored by bescoto's avatar bescoto

Restoring/regressing now uses less memory


git-svn-id: http://svn.savannah.nongnu.org/svn/rdiff-backup@480 2b77aa54-bcbc-44c9-a7ec-4f6cf2b41109
parent e72bbed3
...@@ -8,6 +8,9 @@ Added --list-increment-sizes option from the development branch. ...@@ -8,6 +8,9 @@ Added --list-increment-sizes option from the development branch.
Previously this option was in the man page but was omitted in the code Previously this option was in the man page but was omitted in the code
(thanks to Michael Schwendt for report). (thanks to Michael Schwendt for report).
Restoring/regressing should now take less memory, especially on large
directories. CPU usage may slightly increase, however.
New in v0.12.5 (2003/09/27) New in v0.12.5 (2003/09/27)
--------------------------- ---------------------------
......
...@@ -136,8 +136,7 @@ See the ...@@ -136,8 +136,7 @@ See the
section for more information. section for more information.
.TP .TP
.B --exclude-special-files .B --exclude-special-files
Exclude all device files, fifos, sockets, and symlinks. This option Exclude all device files, fifos, sockets, and symlinks.
is implied by --windows-mode.
.TP .TP
.B --force .B --force
Authorize the updating or overwriting of a destination path. Authorize the updating or overwriting of a destination path.
......
...@@ -513,29 +513,39 @@ as data loss may result.\n""" % (self.mirror_rp.get_indexpath(),), 2) ...@@ -513,29 +513,39 @@ as data loss may result.\n""" % (self.mirror_rp.get_indexpath(),), 2)
""" """
if not inc_rpath.isdir(): return if not inc_rpath.isdir(): return
inc_dict = {} # dictionary of basenames:IndexedTuples(index, inc_list)
dirlist = robust.listrp(inc_rpath) def get_inc_pairs():
"""Return unsorted list of (basename, inc_filenames) pairs"""
def affirm_dict_indexed(basename): inc_dict = {} # dictionary of basenames:inc_filenames
"""Make sure the rid dictionary has given basename as key""" dirlist = robust.listrp(inc_rpath)
if not inc_dict.has_key(basename):
sub_inc_rp = inc_rpath.append(basename) def add_to_dict(filename):
inc_dict[basename] = rorpiter.IndexedTuple(sub_inc_rp.index, """Add filename to the inc tuple dictionary"""
(sub_inc_rp, [])) rp = inc_rpath.append(filename)
if rp.isincfile() and rp.getinctype() != 'data':
def add_to_dict(filename): basename = rp.getincbase_str()
"""Add filename to the inc tuple dictionary""" inc_filename_list = inc_dict.setdefault(basename, [])
rp = inc_rpath.append(filename) inc_filename_list.append(filename)
if rp.isincfile() and rp.getinctype() != 'data': elif rp.isdir(): inc_dict.setdefault(filename, [])
basename = rp.getincbase_str()
affirm_dict_indexed(basename) for filename in dirlist: add_to_dict(filename)
inc_dict[basename][1].append(rp) return inc_dict.items()
elif rp.isdir(): affirm_dict_indexed(filename)
def inc_filenames2incrps(filenames):
for filename in dirlist: add_to_dict(filename) """Map list of filenames into increment rps"""
keys = inc_dict.keys() l = []
keys.sort() for filename in filenames:
for key in keys: yield inc_dict[key] rp = inc_rpath.append(filename)
assert rp.isincfile(), rp.path
l.append(rp)
return l
items = get_inc_pairs()
items.sort() # Sorting on basis of basename now
for (basename, inc_filenames) in items:
sub_inc_rpath = inc_rpath.append(basename)
yield rorpiter.IndexedTuple(sub_inc_rpath.index,
(sub_inc_rpath, inc_filenames2incrps(inc_filenames)))
class PatchITRB(rorpiter.ITRBranch): class PatchITRB(rorpiter.ITRBranch):
......
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