shelve: inline ".patch" constant now that it's only used in the Shelf class
authorMartin von Zweigbergk <martinvonz@google.com>
Mon, 11 Jan 2021 10:53:42 -0800
changeset 46294 d3b226b6c8c6
parent 46293 9cdef4c41c94
child 46295 f8c5e6ecd008
shelve: inline ".patch" constant now that it's only used in the Shelf class Differential Revision: https://phab.mercurial-scm.org/D9741
mercurial/shelve.py
--- a/mercurial/shelve.py	Mon Jan 11 23:06:45 2021 -0800
+++ b/mercurial/shelve.py	Mon Jan 11 10:53:42 2021 -0800
@@ -64,8 +64,6 @@
 backupdir = b'shelve-backup'
 shelvedir = b'shelved'
 shelvefileextensions = [b'hg', b'patch', b'shelve']
-# universal extension is present in all types of shelves
-patchextension = b'patch'
 
 # we never need the user, so we use a
 # generic user for all shelve operations
@@ -89,12 +87,12 @@
         return Shelf(vfsmod.vfs(repo.vfs.join(shelvedir)), name)
 
     def exists(self):
-        return self.vfs.exists(
-            self.name + b'.' + patchextension
-        ) and self.vfs.exists(self.name + b'.hg')
+        return self.vfs.exists(self.name + b'.patch') and self.vfs.exists(
+            self.name + b'.hg'
+        )
 
     def mtime(self):
-        return self.vfs.stat(self.name + b'.' + patchextension)[stat.ST_MTIME]
+        return self.vfs.stat(self.name + b'.patch')[stat.ST_MTIME]
 
     def writeinfo(self, info):
         scmutil.simplekeyvaluefile(self.vfs, self.name + b'.shelve').write(info)