forked from mirrors/jj
cli: also update descendant branches after rewriting working copy commit
After writing a new working copy commit, we update branches pointing to it, and we rebase descendants on top. However, we should be doing that in the opposite order, so the branch updates apply to rewritten descendants as well.
This commit is contained in:
parent
38474a9fb9
commit
3e938752d1
1 changed files with 4 additions and 3 deletions
|
@ -382,9 +382,6 @@ impl RepoCommandHelper {
|
|||
.write_to_repo(mut_repo);
|
||||
mut_repo.set_checkout(commit.id().clone());
|
||||
|
||||
// Update branches pointing to the old checkout
|
||||
update_branches_after_rewrite(mut_repo);
|
||||
|
||||
// Evolve descendants (though it currently evolves all commits)
|
||||
let evolve_result = evolve_orphans(&self.settings, mut_repo)?;
|
||||
if evolve_result.num_resolved > 0 {
|
||||
|
@ -403,6 +400,10 @@ impl RepoCommandHelper {
|
|||
)?;
|
||||
}
|
||||
|
||||
// Update branches pointing to the old checkout and any branches pointing to
|
||||
// descendants.
|
||||
update_branches_after_rewrite(mut_repo);
|
||||
|
||||
self.repo = tx.commit();
|
||||
locked_wc.finish(commit);
|
||||
} else {
|
||||
|
|
Loading…
Reference in a new issue