Create a new branch at a certain revision

Preface: Mercurial branches are two types:

  • named branch
  • anonymous

Named Branch

In order to get named branch BRANCHNAME, starting at REV

hg update REV
hg branch BRANCHNAME
...
hg commit

commit is a must, because

the branch will not exist in the repository until the next commit

as noted in hg help branch

Anonymous branch

hg update REV
...
hg commit

and current branch get additional head


And as a last step, use the following command to create a remote branch and push the changesets.

hg push --new-branch

Leave a Comment

Hata!: SQLSTATE[HY000] [1045] Access denied for user 'divattrend_liink'@'localhost' (using password: YES)