Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Creating a mercurial log for a specific branch

Is it possible to pull changes for just a single branch vs. the entire repository. We have parallel development on different branches and do not want changes from another build in the log.

hg log -r %baseversion%:%releaseversion% --style changelog >> hglog.txt 

I tried doing this this way but it pulled every change between the base tag and the release tag.

like image 547
themaniac27 Avatar asked Oct 18 '12 14:10

themaniac27


People also ask

How to create new branch Mercurial?

Creating a branch Branching can happen by committing a changeset within a single repository or by committing diverging changes in distinct (but related) repositories. Two repositories are said to be related if they were once cloned from the same repository but later may have diverged.

How do I change my branch on Mercurial?

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.

What does hg commit do?

Use the command hg update to switch to an existing branch. Use hg commit --close-branch to mark this branch head as closed. When all heads of a branch are closed, the branch will be considered closed.

What is hg changeset?

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.


1 Answers

If you're using proper hg branches, then you should be able to use the --only-branch option:

hg log --only-branch my_branch 

That will show the changesets only for a given branch.

Edit: Looks like "--only-branch" is deprecated, but depending on the version of mercurial you use it will still be there. See https://www.mercurial-scm.org/repo/hg/help/log . If your mercurial is too new, you may only have the "-b"/"--branch" option.

like image 142
criswell Avatar answered Nov 10 '22 04:11

criswell