# HG changeset patch # User Martin von Zweigbergk # Date 1610089744 28800 # Node ID d7f763c8c58e0d03c0baf60ae217a93bb7737b0a # Parent 8db5fa212ab0d819bc523088c9364bd85021a9f7 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 diff -r 8db5fa212ab0 -r d7f763c8c58e mercurial/shelve.py --- 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():