From: Rob Browning Date: Sun, 26 Jul 2015 15:26:35 +0000 (-0500) Subject: vfs: remove support for /foo/TAG (keep /.tag/TAG) X-Git-Tag: 0.28-rc1~71 X-Git-Url: https://arthur.barton.de/gitweb/?p=bup.git;a=commitdiff_plain;h=ea6e06e961e1b8711a44f9085ed4cfc2ae3d2392 vfs: remove support for /foo/TAG (keep /.tag/TAG) Don't interleave the tags with the branch save dates in the VFS. Doing so meant that any access to the /branch required retrieving all tags in the repository. It also introduced the possibility of duplicate tag and date names. Tags are still available in the global /.tag directory. Signed-off-by: Rob Browning Tested-by: Rob Browning --- diff --git a/Documentation/bup-tag.md b/Documentation/bup-tag.md index 28d5233..49416a4 100644 --- a/Documentation/bup-tag.md +++ b/Documentation/bup-tag.md @@ -31,13 +31,6 @@ bup exposes the contents of backups with current tags, via any command that lists or shows backups. They can be found under the /.tag directory. For example, the 'ftp' command will show the tag named 'tag1' under /.tag/tag1. -Tags are also exposed under the branches from which they can be reached. For -example, if you create a tag named 'important' under branch 'computerX', you -will also be able to retrieve the contents of the backup that was tagged under -/computerX/important. This is done as a convenience, and should the branch -'computerX' be deleted, the contents of the tagged backup will be available -through /.tag/important as long as the tag is not deleted. - # OPTIONS -d, \--delete diff --git a/lib/bup/vfs.py b/lib/bup/vfs.py index f1c6a7b..2c1f4eb 100644 --- a/lib/bup/vfs.py +++ b/lib/bup/vfs.py @@ -544,8 +544,6 @@ class BranchList(Node): def _mksubs(self): self._subs = {} - tags = git.tags(repo_dir = self._repo_dir) - revs = list(git.rev_list(self.hash.encode('hex'), repo_dir=self._repo_dir)) latest = revs[0] @@ -558,11 +556,6 @@ class BranchList(Node): n1.ctime = n1.mtime = date self._subs[ls] = n1 - for tag in tags.get(commit, []): - t1 = FakeSymlink(self, tag, target, self._repo_dir) - t1.ctime = t1.mtime = date - self._subs[tag] = t1 - (date, commit) = latest commithex = commit.encode('hex') target = '../.commit/%s/%s' % (commithex[:2], commithex[2:]) diff --git a/t/test-ls.sh b/t/test-ls.sh index 0b8fbcf..01c8596 100755 --- a/t/test-ls.sh +++ b/t/test-ls.sh @@ -60,8 +60,7 @@ WVPASSEQ "$(WVPASS bup ls /.tag)" "some-tag" WVPASSEQ "$(WVPASS bup ls /src)" \ "1977-09-05-125600 -latest -some-tag" +latest" WVPASSEQ "$(WVPASS bup ls src/latest/"$tmpdir"/src)" "executable fifo @@ -206,7 +205,6 @@ WVPASSEQ "$(bup ls -ld "src/latest$tmpdir/src" | tr -s ' ' ' ')" \ WVSTART "ls (backup set - long)" WVPASSEQ "$(bup ls -l src | cut -d' ' -f 1-2)" \ "l--------- ?/? -l--------- ?/? l--------- ?/?"