##// END OF EJS Templates
shelve: inline ".patch" constant now that it's only used in the Shelf class...
Martin von Zweigbergk -
r47012:d3b226b6 default
parent child Browse files
Show More
@@ -64,8 +64,6 b' from .utils import ('
64 backupdir = b'shelve-backup'
64 backupdir = b'shelve-backup'
65 shelvedir = b'shelved'
65 shelvedir = b'shelved'
66 shelvefileextensions = [b'hg', b'patch', b'shelve']
66 shelvefileextensions = [b'hg', b'patch', b'shelve']
67 # universal extension is present in all types of shelves
68 patchextension = b'patch'
69
67
70 # we never need the user, so we use a
68 # we never need the user, so we use a
71 # generic user for all shelve operations
69 # generic user for all shelve operations
@@ -89,12 +87,12 b' class Shelf(object):'
89 return Shelf(vfsmod.vfs(repo.vfs.join(shelvedir)), name)
87 return Shelf(vfsmod.vfs(repo.vfs.join(shelvedir)), name)
90
88
91 def exists(self):
89 def exists(self):
92 return self.vfs.exists(
90 return self.vfs.exists(self.name + b'.patch') and self.vfs.exists(
93 self.name + b'.' + patchextension
91 self.name + b'.hg'
94 ) and self.vfs.exists(self.name + b'.hg')
92 )
95
93
96 def mtime(self):
94 def mtime(self):
97 return self.vfs.stat(self.name + b'.' + patchextension)[stat.ST_MTIME]
95 return self.vfs.stat(self.name + b'.patch')[stat.ST_MTIME]
98
96
99 def writeinfo(self, info):
97 def writeinfo(self, info):
100 scmutil.simplekeyvaluefile(self.vfs, self.name + b'.shelve').write(info)
98 scmutil.simplekeyvaluefile(self.vfs, self.name + b'.shelve').write(info)
General Comments 0
You need to be logged in to leave comments. Login now