[PATCH 1/1] vfs: fix conversion of names to a set in tree_items and tag_items

1 view
Skip to first unread message

Rob Browning

unread,
Nov 25, 2023, 1:47:29 PM11/25/23
to bup-...@googlegroups.com
It looks like this was inverted in 0.33.x. It was intended as a
performance optimization if a large number of specific names are
requested.

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

Proposed for 0.33.x and main.

lib/bup/vfs.py | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/lib/bup/vfs.py b/lib/bup/vfs.py
index 541a28f3b..bbe5ba08b 100644
--- a/lib/bup/vfs.py
+++ b/lib/bup/vfs.py
@@ -677,7 +677,7 @@ def tree_items(oid, tree_data, names=frozenset(), bupm=None):

# Assumes the tree is properly formed, i.e. there are no
# duplicates, and entries will be in git tree order.
- if isinstance(names, (frozenset, set)):
+ if not isinstance(names, (frozenset, set)):
names = frozenset(names)
remaining = len(names)

@@ -855,7 +855,7 @@ def tags_items(repo, names):
return

# Assumes no duplicate refs
- if isinstance(names, (frozenset, set)):
+ if not isinstance(names, (frozenset, set)):
names = frozenset(names)
remaining = len(names)
last_name = max(names)
--
2.39.2

Rob Browning

unread,
Nov 26, 2023, 9:21:11 PM11/26/23
to bup-...@googlegroups.com
Rob Browning <r...@defaultvalue.org> writes:

> It looks like this was inverted in 0.33.x. It was intended as a
> performance optimization if a large number of specific names are
> requested.

Pushed to 0.33.x and main.

--
Rob Browning
rlb @defaultvalue.org and @debian.org
GPG as of 2011-07-10 E6A9 DA3C C9FD 1FF8 C676 D2C4 C0F0 39E9 ED1B 597A
GPG as of 2002-11-03 14DD 432F AE39 534D B592 F9A0 25C8 D377 8C7E 73A4
Reply all
Reply to author
Forward
0 new messages