I want to move a changeset from one branch to another. Basically, I currently have:
A -> B -> C -> D # default branch
And I want:
A # default branch \-> B -> C -> D # some_new_branch
Where some_new_branch does not exist yet. I am used to git, so I guess there is a simple "mercurial" way I am missing.
From the main menu, select Hg | Mercurial | Update to. In the Switch Working Directory dialog that opens, specify the target working directory: To switch to another line of development, choose Branch and select the desired branch from the list.
Revert changes already committed To backout a specific changeset use hg backout -r CHANGESET . This will prompt you directly with a request for the commit message to use in the backout. To revert a file to a specific changeset, use hg revert -r CHANGESET FILENAME . This will revert the file without committing it.
A changeset (sometimes abbreviated "cset") is an atomic collection of changes to files in a repository. It contains all recorded local modification that lead to a new revision of the repository. A changeset is identified uniquely by a changeset ID. In a single repository, you can identify it using a revision number.
One way is to export a patch for B,C,D; update to A; branch; apply patch:
hg export -o patch B C D hg update A hg branch branchname hg import patch
To remove B,C,D from the default branch, use the mq extension's strip
command.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With