Default rewriting branch in Mercurial

Let's say I had a branch with feature_x functions that I was working on, and then changes the cherries and changes to the default value, then the branch is closed. Not the best stream, but it is Mercurial, so there is no way to change the story.

Now I will work on function X again, and I feel that reusing the feature_x branch will be the least confusing. However, if I open this branch again and merge it with default , I will have two problems. The first merge conflicts, the second changes that were changed in this thread, but never merged with default. So I would like to have a clean slate, a feature_x branch, but with an exact copy of what is currently in default . Is there a cleaner way to do this than create a new branch that obscures the name?

0
source share
1 answer

I think it’s best to start a new branch from the current default tip called feature_x2 or feature_y and leave the past in the past.

But here are some other options:

  • Is the old feature_x branch feature_x locally to your repo or has it been clicked? If the first one, you can hg strip it and run the branch again with the current default .

  • If the name feature_x really, really important, you can make it default by using internal merge tools and make it reflect the default branch exactly by doing

     hg merge -r default --tool internal:other 
  • Or you can simply copy a copy of default (file system) over the tip of branch_x . Then you can continue this thread along your fun path.

I do not know if 2. or 3. will cause strange merging problems in the future. I would check if the merger could return to default (or another graft?) Could cause problems later.

+1
source

Source: https://habr.com/ru/post/985067/


All Articles