hg commandname --help
.hg pull
to download the latest changes from the remote repository.hg update tip
to update your current working directoryhg bookmark some-bookmark-name
to create a bookmarkhg bookmarks
to list all of your bookmarks and see which one is currently active.hg log --graph
or hg wip
to see which bookmarks point to which changesets.hg status
and hg diff
to check what files and changes you are about to commit.hg add some-filename
before committing.hg commit -m "Bug ##### - fixing something amazing"
.-m
is short for --message
and lets you provide a commit message for your changeset.hg log --graph
to see examples of commit messages.hg log --graph
or hg wip
and note how the bookmark has moved to the changeset that youhg commit --amend
to modify the current changeset rather than making a new one.hg export --rev feature-A > my-feature-a-file.patch
to create a patch file. The --rev feature-A
part indicates which revision (changeset) you want, in this case the changeset that the bookmark feature-A
points to.feature-A
as described above, but now you want to switch to working on feature B. Here is how that can work.hg log --graph
or hg wip
and copy the identifying number of the first changesethg update --rev 26858
to change the state of your current working directory to that changeset.hg bookmark feature-B
to create a new bookmark to work on feature B.hg update feature-A
.feature-A
changesetfeature-A
the active bookmark.hg update feature-B
.feature-B
changesetfeature-B
the active bookmark.hg rebase
.hg pull
.hg log --graph
or hg wip
to see if there are new changesets andhg rebase -b my-bookmark-name -d 54321
.-b
is for bookmark and the -d
is for destination.my-bookmark-name
54321
.hg pull
you have this:hg rebase -b my-bookmark-name -d tip
you have:hg export --rev NNN > my-patch-file.patch
for each of C2, D2, and E2, where NNN is the number (or hash) for the changeset.hg rebase -s 44444 -d 54321
. Where -s
indicates a source changset. That will apply the source changeset on top of the destination changeset.hg rebase -s 44444 -d 54321
would do the same thing as hg rebase -b my-bookmark-name -d 54321
.hg resolve --mark
to mark the conflicts as resolved.hg rebase --continue
and Mercurial will continue the rebase operation.hg rebase --abort
.