equal
deleted
inserted
replaced
1124 self.vfs.tryread("bookmarks")) |
1124 self.vfs.tryread("bookmarks")) |
1125 self.svfs.write("journal.phaseroots", |
1125 self.svfs.write("journal.phaseroots", |
1126 self.svfs.tryread("phaseroots")) |
1126 self.svfs.tryread("phaseroots")) |
1127 |
1127 |
1128 def recover(self): |
1128 def recover(self): |
1129 lock = self.lock() |
1129 with self.lock(): |
1130 try: |
|
1131 if self.svfs.exists("journal"): |
1130 if self.svfs.exists("journal"): |
1132 self.ui.status(_("rolling back interrupted transaction\n")) |
1131 self.ui.status(_("rolling back interrupted transaction\n")) |
1133 vfsmap = {'': self.svfs, |
1132 vfsmap = {'': self.svfs, |
1134 'plain': self.vfs,} |
1133 'plain': self.vfs,} |
1135 transaction.rollback(self.svfs, vfsmap, "journal", |
1134 transaction.rollback(self.svfs, vfsmap, "journal", |
1137 self.invalidate() |
1136 self.invalidate() |
1138 return True |
1137 return True |
1139 else: |
1138 else: |
1140 self.ui.warn(_("no interrupted transaction available\n")) |
1139 self.ui.warn(_("no interrupted transaction available\n")) |
1141 return False |
1140 return False |
1142 finally: |
|
1143 lock.release() |
|
1144 |
1141 |
1145 def rollback(self, dryrun=False, force=False): |
1142 def rollback(self, dryrun=False, force=False): |
1146 wlock = lock = dsguard = None |
1143 wlock = lock = dsguard = None |
1147 try: |
1144 try: |
1148 wlock = self.wlock() |
1145 wlock = self.wlock() |