What's the best way to close a Mercurial branch?

后端 未结 3 1885
忘掉有多难
忘掉有多难 2021-02-12 16:25

Is it better to first close a branch and then merge it with the default branch(for instance) or first merge it and then close it?

In TortoiseHg for instance, in the firs

3条回答
  •  深忆病人
    2021-02-12 16:42

    As my company recently found out, there is a pretty good reason to prefer close-them-merge. As other answers have discussed, in merge-then-close you end up with an extra "topological head", whereas in close-then-merge you don't leave this extra head behind.

    It turns out these extra heads add up, and can eventually cause problems in sync operations ( where Mercurial needs to negotiate which heads are on which side to discover the changesets to push or pull ). As the number of dangling topological heads grows, these operations get larger and larger, until eventually they start to fail. Thankfully, you can pretty easily clean them up later but it's probably best to avoid the problem in the first place.

提交回复
热议问题