shelve: make gennames() helper generate relative backup paths
When I saw `gennames()`, I thought it was meant to take a relative
filename as argument. Maybe it was or maybe it wasn't, but it seems
simpler to pass it a relative path anyway, so that's what this patch
does. That also makes the call to backupvfs.exists() more natural (I
expect a relative path to be passed there too).
Differential Revision: https://phab.mercurial-scm.org/D9711
--- a/mercurial/shelve.py Thu Jan 07 22:38:19 2021 -0800
+++ b/mercurial/shelve.py Thu Jan 07 23:09:04 2021 -0800
@@ -97,10 +97,9 @@
for i in itertools.count(1):
yield b'%s-%d.%s' % (base, i, ext)
- name = self.backupvfs.join(self.fname)
- for n in gennames(name):
+ for n in gennames(self.fname):
if not self.backupvfs.exists(n):
- return n
+ return self.backupvfs.join(n)
def movetobackup(self):
if not self.backupvfs.isdir():