Show More
@@ -349,8 +349,25 b' def _bookmarkmovements(repo, tostrip):' | |||
|
349 | 349 | def _createstripbackup(repo, stripbases, node, topic): |
|
350 | 350 | # backup the changeset we are about to strip |
|
351 | 351 | vfs = repo.vfs |
|
352 | cl = repo.changelog | |
|
353 | backupfile = backupbundle(repo, stripbases, cl.heads(), node, topic) | |
|
352 | unfi = repo.unfiltered() | |
|
353 | to_node = unfi.changelog.node | |
|
354 | all_backup = unfi.revs( | |
|
355 | b"(%ln)::(%ld)", stripbases, unfi.changelog.headrevs() | |
|
356 | ) | |
|
357 | if not all_backup: | |
|
358 | return None | |
|
359 | ||
|
360 | def to_nodes(revs): | |
|
361 | return [to_node(r) for r in revs] | |
|
362 | ||
|
363 | simpler_bases = to_nodes( | |
|
364 | unfi.revs("roots(%ln::%ln)", stripbases, stripbases) | |
|
365 | ) | |
|
366 | bases = to_nodes(unfi.revs("roots(%ld)", all_backup)) | |
|
367 | heads = to_nodes(unfi.revs("heads(%ld)", all_backup)) | |
|
368 | assert bases == simpler_bases | |
|
369 | assert set(heads).issubset(set(repo.changelog.heads())) | |
|
370 | backupfile = backupbundle(repo, bases, heads, node, topic) | |
|
354 | 371 | repo.ui.status(_(b"saved backup bundle to %s\n") % vfs.join(backupfile)) |
|
355 | 372 | repo.ui.log( |
|
356 | 373 | b"backupbundle", b"saved backup bundle to %s\n", vfs.join(backupfile) |
General Comments 0
You need to be logged in to leave comments.
Login now