]> arthur.barton.de Git - bup.git/commit - t/test.sh
Make bup-split commits appear as files to the vfs layer.
authorYung-Chin Oei <yungchin@yungchin.nl>
Mon, 8 Oct 2012 14:08:34 +0000 (15:08 +0100)
committerRob Browning <rlb@defaultvalue.org>
Sun, 6 Apr 2014 20:16:35 +0000 (15:16 -0500)
commit6068aef0fae35566a5da926f141b9c69a3c38017
tree4c74b031444197cb9a72b2c3be6bc52b6a96cef6
parentdd9e22dc64b2716caec076ebbee65400c4c9f957
Make bup-split commits appear as files to the vfs layer.

When viewing branches that were generated by bup-split through bup-fuse
(or any other frontend relying on vfs.py), these are presented as trees
of the hashsplitted blobs. This means that bup-split output is only
usefully accessible through bup-join.

This change makes bup-split store named commits such that they appear as
files, named with the last component of their branch name(*). That is,
from the vfs layer, they now appear like so:
    branch_name/latest/branch_basename

(*) While bup doesn't currently handle slashes in branch names, patches
    to this end are on the mailing list, so this patch should handle
    them, in anticipation of their general support in bup.

To address potential concerns: the storage format is changed in subtle
ways, in that the top level tree now contains a "normally" named object,
rather than byte-offset names.  However, bup-join doesn't care about
this, and as bup-join was previously the only way to use these commits,
the user experience is not affected.

We also add a test for the new functionality. (The test uses an empty
string as input data, because this is the second way in which this patch
changes the behaviour of bup-split: previously, passing empty strings to
bup-split would make it generate an empty git tree, whereas now it
relies on hashsplit.split_to_blob_or_tree() to make a blob for the empty
string. This is meaningful because vfs.py chokes on empty git trees.)

Signed-off-by: Yung-Chin Oei <yungchin@yungchin.nl>
[rlb@defaultvalue.org: rebase to current master; adjust code indentation.]
cmd/split-cmd.py
lib/bup/hashsplit.py
t/test.sh