Check for overflow when converting from Python to unsigned integer types.

Python's PyArg_ParseTuple() unsigned integer type conversions don't
check for overflow, so stop using them.  Add bup_uint_from_py(),
bup_ulong_from_py(), and bup_ullong_from_py() functions that do check,
and use them instead.

Signed-off-by: Rob Browning <rlb@defaultvalue.org>
bup-join.md bup-save.md: note that even with "-r" a local repo is required.

Signed-off-by: Rob Browning <rlb@defaultvalue.org>
bup-restore.md: always initialize root_meta in do_root.

Previously, using bup split with bup restore would cause an error:

  UnboundLocalError: local variable 'root_meta' referenced before assignment

Signed-off-by: itxx00 <itxx00@gmail.com>
[rlb@defaultvalue.org: adjust commit message.  Initialize root_meta
 unconditionally before guard to match other code.]
Signed-off-by: Rob Browning <rlb@defaultvalue.org>
Mention par2 as one of the reasons you might want to avoid bup.

(i.e. add it to the informal list of requirements)

Thanks to James Lott <james@lottspot.com> for the suggestion.

Signed-off-by: Rob Browning <rlb@defaultvalue.org>
metadata.py: remove obsolete comments.

Signed-off-by: Rob Browning <rlb@defaultvalue.org>
tgit.py: use a tmpdir in t/tmp instead of working directly in lib/bup/t/.

Signed-off-by: Rob Browning <rlb@defaultvalue.org>
Change -x/--xdev/--one-filesystem to include the mount point itself.

Match rsync, tar, etc., and add and use t/cleanup-mounts-under to
clean up all temporary mounts under t/mnt and t/tmp.

Thanks to Karl Kiniger <karl.kiniger@med.ge.com> for the report.

Signed-off-by: Rob Browning <rlb@defaultvalue.org>
Tested-by: Karl Kiniger <karl.kiniger@med.ge.com>
tbloom.py: use a tmpdir in t/tmp instead of working directly in lib/bup/t/.

Signed-off-by: Rob Browning <rlb@defaultvalue.org>
save-cmd.py: disallow backup set names containing "/".

There's no way to refer to them via the VFS, because the VFS (as
expected) treats all forward slashes as path separators.

Before this change, it was possible to create backup sets with names
like "x/y/z" that were inaccessible via ls, restore, etc.

Thanks to Laura Morrissey <laura.morrissey@gmail.com> for the report.

Signed-off-by: Rob Browning <rlb@defaultvalue.org>
tclient.py: use a tmpdir in t/tmp instead of working directly in lib/bup/t/.

Signed-off-by: Rob Browning <rlb@defaultvalue.org>
tindex.py: use a tmpdir in t/tmp instead of working directly in lib/bup/t/.

Signed-off-by: Rob Browning <rlb@defaultvalue.org>
tmetadata.py, txstat.py: use t/tmp as the tmpdir parent.

Signed-off-by: Rob Browning <rlb@defaultvalue.org>
tmetadata.py, txstat.py: don't remove tmpdirs when tests fail.

Signed-off-by: Rob Browning <rlb@defaultvalue.org>
t/test.sh: use a tmpdir in t/tmp instead of working directly in ./.

Signed-off-by: Rob Browning <rlb@defaultvalue.org>
git.py: remove unused home_repodir variable.

Signed-off-by: Rob Browning <rlb@defaultvalue.org>
vfs.py: replace "X" placeholder with the instance id in Node.__repr__().

Signed-off-by: Rob Browning <rlb@defaultvalue.org>
bup-index.md: remove misleading --exclude expansion comment.

This comment was originally added in reference to some confusion over
globbing, but the text was misleading because bup does apply
realpath() to all of the --exclude paths, arguably a form of
expansion.

Signed-off-by: Rob Browning <rlb@defaultvalue.org>
Fix drecurse relative --excludes, quash duplicates, and add tests.

Previously "bup drecurse --exclude bar foo" wouldn't work because bar
would be expanded to an absolute path, but drecurse would traverse
(and attempt to match against) relative paths.

Have parse_excludes() remove duplicates and sort its result.

Add some initial drecurse tests.

Signed-off-by: Rob Browning <rlb@defaultvalue.org>
Add --exclude-rx and --exclude-rx-from support to "bup drecurse".

Thanks to nicolas.pouillard@gmail.com for the reminder.

Signed-off-by: Rob Browning <rlb@defaultvalue.org>
metadata.py: add a more meaningful repr() to Metadata.

Signed-off-by: Rob Browning <rlb@defaultvalue.org>