]> arthur.barton.de Git - bup.git/commit - lib/bup/t/thelpers.py
Overhaul restore destination handling, and stripping/grafting behavior.
authorRob Browning <rlb@defaultvalue.org>
Sat, 18 Aug 2012 20:26:28 +0000 (15:26 -0500)
committerRob Browning <rlb@defaultvalue.org>
Sat, 2 Feb 2013 21:17:20 +0000 (15:17 -0600)
commit042eaac10b2650a71f7e8604cfac8213091ec1be
tree385b8a3bb0fbeaf0ab0225bf5fb203ad305f42d0
parent66ff902e6318b118dfff03cbec3d9579f5bd248d
Overhaul restore destination handling, and stripping/grafting behavior.

Change restore to respond to source paths like this (assume outdir
corresponds to "." if there no -C argument or to -C outdir):

  /foo/what/ever - extract ever to outdir/ever
  /foo/what/ever/ - extract ever/* to outdir/*
  /foo/what/ever/. - extract ever/. to outdir/. (i.e. outdir == ever).

Also fix handling of top-level commit symlinks.  Previously bup would
just restore /foo/latest as a dummy symlink like this:

   latest -> ../.commit/SHA

Instead, dereference latest and restore the target instead.

Tighten up stripping/grafting with additional argument checks, and
handle any root collisions by creating a fake root dir (see comments
in save-cmd.py).  Bup still doesn't handle other path collisions yet,
i.e. if both /foo/bar and /bar are remapped to /bar.

Signed-off-by: Rob Browning <rlb@defaultvalue.org>
Reviewed-by: Zoran Zaric <zz@zoranzaric.de>
cmd/restore-cmd.py
cmd/save-cmd.py
lib/bup/helpers.py
lib/bup/t/thelpers.py
lib/bup/vfs.py
t/test.sh