##// END OF EJS Templates
transaction: make undoname a private attribute...
Gregory Szorc -
r39711:da9ce63b default
parent child Browse files
Show More
@@ -132,7 +132,7 b' class transaction(util.transactional):'
132 self.entries = []
132 self.entries = []
133 self.map = {}
133 self.map = {}
134 self.journal = journalname
134 self.journal = journalname
135 self.undoname = undoname
135 self._undoname = undoname
136 self._queue = []
136 self._queue = []
137 # A callback to validate transaction content before closing it.
137 # A callback to validate transaction content before closing it.
138 # should raise exception is anything is wrong.
138 # should raise exception is anything is wrong.
@@ -532,9 +532,10 b' class transaction(util.transactional):'
532
532
533 def _writeundo(self):
533 def _writeundo(self):
534 """write transaction data for possible future undo call"""
534 """write transaction data for possible future undo call"""
535 if self.undoname is None:
535 if self._undoname is None:
536 return
536 return
537 undobackupfile = self.opener.open("%s.backupfiles" % self.undoname, 'w')
537 undobackupfile = self.opener.open("%s.backupfiles" % self._undoname,
538 'w')
538 undobackupfile.write('%d\n' % version)
539 undobackupfile.write('%d\n' % version)
539 for l, f, b, c in self._backupentries:
540 for l, f, b, c in self._backupentries:
540 if not f: # temporary file
541 if not f: # temporary file
@@ -549,7 +550,7 b' class transaction(util.transactional):'
549 vfs = self._vfsmap[l]
550 vfs = self._vfsmap[l]
550 base, name = vfs.split(b)
551 base, name = vfs.split(b)
551 assert name.startswith(self.journal), name
552 assert name.startswith(self.journal), name
552 uname = name.replace(self.journal, self.undoname, 1)
553 uname = name.replace(self.journal, self._undoname, 1)
553 u = vfs.reljoin(base, uname)
554 u = vfs.reljoin(base, uname)
554 util.copyfile(vfs.join(b), vfs.join(u), hardlink=True)
555 util.copyfile(vfs.join(b), vfs.join(u), hardlink=True)
555 undobackupfile.write("%s\0%s\0%s\0%d\n" % (l, f, u, c))
556 undobackupfile.write("%s\0%s\0%s\0%d\n" % (l, f, u, c))
General Comments 0
You need to be logged in to leave comments. Login now