##// END OF EJS Templates
shelve: move method for reading .shelve file to new shelf class...
Martin von Zweigbergk -
r46901:2e14b933 default draft
parent child Browse files
Show More
@@ -163,9 +163,6 b' class shelvedfile(object):'
163 163 self.ui, cg, self.fname, btype, self.vfs, compression=compression
164 164 )
165 165
166 def readinfo(self):
167 return scmutil.simplekeyvaluefile(self.vfs, self.fname).read()
168
169 166
170 167 class Shelf(object):
171 168 """Represents a shelf, including possibly multiple files storing it.
@@ -186,6 +183,11 b' class Shelf(object):'
186 183 def writeinfo(self, info):
187 184 scmutil.simplekeyvaluefile(self.vfs, self.name + b'.shelve').write(info)
188 185
186 def readinfo(self):
187 return scmutil.simplekeyvaluefile(
188 self.vfs, self.name + b'.shelve'
189 ).read()
190
189 191
190 192 class shelvedstate(object):
191 193 """Handle persistence during unshelving operations.
@@ -894,7 +896,7 b' def _unshelverestorecommit(ui, repo, tr,'
894 896 repo = repo.unfiltered()
895 897 node = None
896 898 if shelvedfile(repo, basename, b'shelve').exists():
897 node = shelvedfile(repo, basename, b'shelve').readinfo()[b'node']
899 node = Shelf(repo, basename).readinfo()[b'node']
898 900 if node is None or node not in repo:
899 901 with ui.configoverride({(b'ui', b'quiet'): True}):
900 902 shelvectx = shelvedfile(repo, basename, b'hg').applybundle(tr)
General Comments 0
You need to be logged in to leave comments. Login now