I converted a repository from Git to Mercurial, and created a named branch production for our production development. Unfortunately, a week later, we’ve just realized the production branch is on the wrong changeset.
Although we’ve made a number of changes to the repository, there haven’t been any commits to the production branch yet. I need to somehow reassociate the production name with the correct changeset, or delete the branch and recreate it.
What’s the best way of doing this?
You can do it, very easily, by using the
mqextension. Obviously, this requires everyone to get a new clone of the repository.If the
productionbranch was created in changeset 869, and you wanted it on changeset 842, you can say:This will remove changeset 869 (and all its descendants) from the repository, renumbering any subsequent changesets to fill in the gaps, and then assign the
productionname to the correct changeset.