Patchwork D9741: shelve: inline ".patch" constant now that it's only used in the Shelf class

login
register
mail settings
Submitter phabricator
Date Jan. 12, 2021, 10:49 p.m.
Message ID <differential-rev-PHID-DREV-57t52so5c7el3kqdkpra-req@mercurial-scm.org>
Download mbox | patch
Permalink /patch/48052/
State Superseded
Headers show

Comments

phabricator - Jan. 12, 2021, 10:49 p.m.
martinvonz created this revision.
Herald added a reviewer: hg-reviewers.
Herald added a subscriber: mercurial-patches.

REPOSITORY
  rHG Mercurial

BRANCH
  default

REVISION DETAIL
  https://phab.mercurial-scm.org/D9741

AFFECTED FILES
  mercurial/shelve.py

CHANGE DETAILS




To: martinvonz, #hg-reviewers
Cc: mercurial-patches, mercurial-devel

Patch

diff --git a/mercurial/shelve.py b/mercurial/shelve.py
--- a/mercurial/shelve.py
+++ b/mercurial/shelve.py
@@ -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)