Mercurial > hg-stable
changeset 46294:d3b226b6c8c6
shelve: inline ".patch" constant now that it's only used in the Shelf class
Differential Revision: https://phab.mercurial-scm.org/D9741
author | Martin von Zweigbergk <martinvonz@google.com> |
---|---|
date | Mon, 11 Jan 2021 10:53:42 -0800 |
parents | 9cdef4c41c94 |
children | f8c5e6ecd008 |
files | mercurial/shelve.py |
diffstat | 1 files changed, 4 insertions(+), 6 deletions(-) [+] |
line wrap: on
line diff
--- 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)