##// END OF EJS Templates
shelve: move method for getting stat (mtime) to new shelf class...
Martin von Zweigbergk -
r46998:7e300d29 default
parent child Browse files
Show More
@@ -110,9 +110,6 b' class shelvedfile(object):'
110 self.backupvfs.makedir()
110 self.backupvfs.makedir()
111 util.rename(self.filename(), self.backupfilename())
111 util.rename(self.filename(), self.backupfilename())
112
112
113 def stat(self):
114 return self.vfs.stat(self.fname)
115
116
113
117 class Shelf(object):
114 class Shelf(object):
118 """Represents a shelf, including possibly multiple files storing it.
115 """Represents a shelf, including possibly multiple files storing it.
@@ -130,6 +127,9 b' class Shelf(object):'
130 def exists(self):
127 def exists(self):
131 return self.vfs.exists(self.name + b'.' + patchextension)
128 return self.vfs.exists(self.name + b'.' + patchextension)
132
129
130 def mtime(self):
131 return self.vfs.stat(self.name + b'.' + patchextension)[stat.ST_MTIME]
132
133 def writeinfo(self, info):
133 def writeinfo(self, info):
134 scmutil.simplekeyvaluefile(self.vfs, self.name + b'.shelve').write(info)
134 scmutil.simplekeyvaluefile(self.vfs, self.name + b'.shelve').write(info)
135
135
@@ -642,8 +642,8 b' def listshelves(repo):'
642 pfx, sfx = name.rsplit(b'.', 1)
642 pfx, sfx = name.rsplit(b'.', 1)
643 if not pfx or sfx != patchextension:
643 if not pfx or sfx != patchextension:
644 continue
644 continue
645 st = shelvedfile(repo, name).stat()
645 mtime = Shelf(repo, pfx).mtime()
646 info.append((st[stat.ST_MTIME], shelvedfile(repo, pfx).filename()))
646 info.append((mtime, shelvedfile(repo, pfx).filename()))
647 return sorted(info, reverse=True)
647 return sorted(info, reverse=True)
648
648
649
649
General Comments 0
You need to be logged in to leave comments. Login now