Skip to content

Instantly share code, notes, and snippets.

@agentgt
Created March 12, 2020 13:38
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save agentgt/97db11fadafed1579564b630138fc769 to your computer and use it in GitHub Desktop.
Save agentgt/97db11fadafed1579564b630138fc769 to your computer and use it in GitHub Desktop.
Using evolve for branching
hg init
echo Upstream1 > main.txt
hg add main.txt
hg commit -m "Master1"
hg branch -q feature
echo feature1 > feature.txt
hg add feature.txt
hg commit -m "Feature1"
echo feature2 >> feature.txt
hg commit -m "Feature2"
hg up default
echo Upstream2 > main.txt
hg commit -m "Master2"
now at this point you have two branches, you commit your feature branch to your testing repo for inspection, once you are satisfied you run
hg rebase -d . -b feature --collapse
Now
hg log -G --hidden
shows you your hidden branch. The point is if you now push the hidden branch will not be pushed. Another effect is, that you can reuse the name of the named branch again later. This all only works with the evolve extension enabled. I find it very useful (although most of the times I prefer merge over rebase).
regards
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment