##// END OF EJS Templates
undo-files: no longer pass the `repo` to `cleanup_undo_files`...
marmoute -
r51196:d89eecf9 stable
parent child Browse files
Show More
@@ -294,7 +294,7 b' def handlechangegroup_widen(op, inpart):'
294 294 finally:
295 295 f.close()
296 296
297 transaction.cleanup_undo_files(repo)
297 transaction.cleanup_undo_files(repo.ui.warn, repo.vfs_map)
298 298
299 299 # Remove partial backup only if there were no exceptions
300 300 op._widen_uninterr.__exit__(None, None, None)
@@ -259,7 +259,7 b' def strip(ui, repo, nodelist, backup=Tru'
259 259 bmchanges = [(m, repo[newbmtarget].node()) for m in updatebm]
260 260 repo._bookmarks.applychanges(repo, tr, bmchanges)
261 261
262 transaction.cleanup_undo_files(repo)
262 transaction.cleanup_undo_files(repo.ui.warn, repo.vfs_map)
263 263
264 264 except: # re-raises
265 265 if backupfile:
@@ -932,4 +932,4 b' def local_copy(src_repo, dest_repo):'
932 932 dest_repo.store.write(tr)
933 933
934 934 # clean up transaction file as they do not make sense
935 transaction.cleanup_undo_files(dest_repo)
935 transaction.cleanup_undo_files(dest_repo.ui.warn, dest_repo.vfs_map)
@@ -50,7 +50,7 b' UNDO_FILES_MAY_NEED_CLEANUP = ['
50 50 ]
51 51
52 52
53 def cleanup_undo_files(repo):
53 def cleanup_undo_files(report, vfsmap):
54 54 """remove "undo" files used by the rollback logic
55 55
56 56 This is useful to prevent rollback running in situation were it does not
@@ -58,21 +58,21 b' def cleanup_undo_files(repo):'
58 58 """
59 59 backup_entries = []
60 60 undo_files = []
61 vfsmap = repo.vfs_map
61 svfs = vfsmap[b'store']
62 62 try:
63 with repo.svfs(UNDO_BACKUP) as f:
64 backup_entries = read_backup_files(repo.ui.warn, f)
63 with svfs(UNDO_BACKUP) as f:
64 backup_entries = read_backup_files(report, f)
65 65 except OSError as e:
66 66 if e.errno != errno.ENOENT:
67 67 msg = _(b'could not read %s: %s\n')
68 msg %= (repo.svfs.join(UNDO_BACKUP), stringutil.forcebytestr(e))
69 repo.ui.warn(msg)
68 msg %= (svfs.join(UNDO_BACKUP), stringutil.forcebytestr(e))
69 report(msg)
70 70
71 71 for location, f, backup_path, c in backup_entries:
72 72 if location in vfsmap and backup_path:
73 73 undo_files.append((vfsmap[location], backup_path))
74 74
75 undo_files.append((repo.svfs, UNDO_BACKUP))
75 undo_files.append((svfs, UNDO_BACKUP))
76 76 for location, undo_path in UNDO_FILES_MAY_NEED_CLEANUP:
77 77 undo_files.append((vfsmap[location], undo_path))
78 78 for undovfs, undofile in undo_files:
@@ -82,7 +82,7 b' def cleanup_undo_files(repo):'
82 82 if e.errno != errno.ENOENT:
83 83 msg = _(b'error removing %s: %s\n')
84 84 msg %= (undovfs.join(undofile), stringutil.forcebytestr(e))
85 repo.ui.warn(msg)
85 report(msg)
86 86
87 87
88 88 def _playback(
General Comments 0
You need to be logged in to leave comments. Login now