ok/jj
1
0
Fork 0
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:
Martin von Zweigbergk 2021-09-26 23:38:42 -07:00
parent 38474a9fb9
commit 3e938752d1

View file

@ -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 {