Bookmark hg after committing changeset

I cloned the Mercurial repo and made some changes to the checked out code. Then I took those changes (7 files) and passed them using hg commit

, but not bookmarking first.

This is the output of my command hg summary

:

parent: 8172:b39efc1322fe tip
  Made some changes in my feature
branch: default
commit: 7 modified
update: 2 new changesets, 3 branch heads (merge)
phases: 3 draft

      

These changes won't be ready to press for at least a week, so I want to go to a new bookmark and work with other parts of the code.

The problem is that I realized that I made a commit without being in the bookmark, so I'm afraid that after switching to a new bookmark, my committed changes might be lost.

Is there an easy way to move these committed changes to a new bookmark?

+3


source to share


2 answers


No need to be afraid at all: mercurial won't forget anything you did unless you explicitly do both: enable history editing extensions and use them willingly in such a way that you actually delete one or more changesets.

Mercurial is not git, and mercurial never forgets or garbage - doesn't collect a changeset when it is currently unchecked and has no name (bookmark) attached to it.



You can show all of your heads using hg heads

. And you can always create new bookmarks attached to an arbitrary hg bookmark --rev XXX MyBookmark

changeset, where XXX is the changeetID you want to attach the bookmark to.

+5


source


I am afraid that after switching to a new bookmark, my committed changes may be lost.

How do you imagine it? OMFG, you committed your changes to the repository (your clone), you have this changeset ( 8172:b39efc1322fe

). When | if you are svn up

on a different node you just change the parent directory of your working directory by pulling you get "2 new changesets" and as a result "3 branch heads" - 2 new changesets + your commit 8172 and this one b39efc1322fe

will always with one of the heads, even you will work and work in the other.



If you are afraid to forget it (as really), you can in fact book this (fixed) changeset with the help hg bookmark -r b39efc1322fe $WIP && hg commit -m "Bookmarked my work"

, so hg up $WIP

that when the time comes to continue this chunk of changes

-3


source







All Articles