1
0
Fork 0
mirror of https://github.com/borgbackup/borg.git synced 2024-12-26 09:47:58 +00:00

Merge pull request #2775 from ThomasWaldmann/fuse-versions-file-ext

FUSE versions view: keep original file extension at end, fixes #2769
This commit is contained in:
TW 2017-07-02 19:12:19 +02:00 committed by GitHub
commit c624e715ad
2 changed files with 7 additions and 4 deletions

View file

@ -22,13 +22,13 @@ Examples
root sbin srv tmp usr var root sbin srv tmp usr var
$ borg umount /tmp/mymountpoint $ borg umount /tmp/mymountpoint
# The experimental versions view merges all archives in the repository # The experimental "versions view" merges all archives in the repository
# and provides a versioned view on files. # and provides a versioned view on files.
$ borg mount -o versions /path/to/repo /tmp/mymountpoint $ borg mount -o versions /path/to/repo /tmp/mymountpoint
$ ls -l /tmp/mymountpoint/home/user/doc.txt/ $ ls -l /tmp/mymountpoint/home/user/doc.txt/
total 24 total 24
-rw-rw-r-- 1 user group 12357 Aug 26 21:19 doc.txt.cda00bc9 -rw-rw-r-- 1 user group 12357 Aug 26 21:19 doc.cda00bc9.txt
-rw-rw-r-- 1 user group 12204 Aug 26 21:04 doc.txt.fa760f28 -rw-rw-r-- 1 user group 12204 Aug 26 21:04 doc.fa760f28.txt
$ borg umount /tmp/mymountpoint $ borg umount /tmp/mymountpoint
borgfs borgfs

View file

@ -351,7 +351,10 @@ def make_versioned_name(name, version, add_dir=False):
# add intermediate directory with same name as filename # add intermediate directory with same name as filename
path_fname = name.rsplit(b'/', 1) path_fname = name.rsplit(b'/', 1)
name += b'/' + path_fname[-1] name += b'/' + path_fname[-1]
return name + os.fsencode('.%08x' % version) # keep original extension at end to avoid confusing tools
name, ext = os.path.splitext(name)
version_enc = os.fsencode('.%08x' % version)
return name + version_enc + ext
if self.versions and not is_dir: if self.versions and not is_dir:
parent = self.process_inner(name, parent) parent = self.process_inner(name, parent)