comparison mercurial/localrepo.py @ 20087:cf3b8285af00

transaction: take journal file path relative to vfs to use file API via vfs
author FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
date Tue, 12 Nov 2013 16:23:52 +0900
parents b04cc8651a63
children 7cbb79bddee7
comparison
equal deleted inserted replaced
20086:f3df2612f3c3 20087:cf3b8285af00
831 831
832 self._writejournal(desc) 832 self._writejournal(desc)
833 renames = [(vfs, x, undoname(x)) for vfs, x in self._journalfiles()] 833 renames = [(vfs, x, undoname(x)) for vfs, x in self._journalfiles()]
834 rp = report and report or self.ui.warn 834 rp = report and report or self.ui.warn
835 tr = transaction.transaction(rp, self.sopener, 835 tr = transaction.transaction(rp, self.sopener,
836 self.sjoin("journal"), 836 "journal",
837 aftertrans(renames), 837 aftertrans(renames),
838 self.store.createmode) 838 self.store.createmode)
839 self._transref = weakref.ref(tr) 839 self._transref = weakref.ref(tr)
840 return tr 840 return tr
841 841
865 def recover(self): 865 def recover(self):
866 lock = self.lock() 866 lock = self.lock()
867 try: 867 try:
868 if self.svfs.exists("journal"): 868 if self.svfs.exists("journal"):
869 self.ui.status(_("rolling back interrupted transaction\n")) 869 self.ui.status(_("rolling back interrupted transaction\n"))
870 transaction.rollback(self.sopener, self.sjoin("journal"), 870 transaction.rollback(self.sopener, "journal",
871 self.ui.warn) 871 self.ui.warn)
872 self.invalidate() 872 self.invalidate()
873 return True 873 return True
874 else: 874 else:
875 self.ui.warn(_("no interrupted transaction available\n")) 875 self.ui.warn(_("no interrupted transaction available\n"))
921 if dryrun: 921 if dryrun:
922 return 0 922 return 0
923 923
924 parents = self.dirstate.parents() 924 parents = self.dirstate.parents()
925 self.destroying() 925 self.destroying()
926 transaction.rollback(self.sopener, self.sjoin('undo'), ui.warn) 926 transaction.rollback(self.sopener, 'undo', ui.warn)
927 if self.vfs.exists('undo.bookmarks'): 927 if self.vfs.exists('undo.bookmarks'):
928 self.vfs.rename('undo.bookmarks', 'bookmarks') 928 self.vfs.rename('undo.bookmarks', 'bookmarks')
929 if self.svfs.exists('undo.phaseroots'): 929 if self.svfs.exists('undo.phaseroots'):
930 self.svfs.rename('undo.phaseroots', 'phaseroots') 930 self.svfs.rename('undo.phaseroots', 'phaseroots')
931 self.invalidate() 931 self.invalidate()