36

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.

themaniac27
  • 1,109
  • 3
  • 15
  • 27

3 Answers3

41

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.

Vadim Kotov
  • 8,084
  • 8
  • 48
  • 62
criswell
  • 759
  • 6
  • 10
18

Also, to show logs only for current branch, ou can use dot instead of current branch name hg log --branch .

maosmurf
  • 1,858
  • 17
  • 16
  • 1
    Perfect, this is what I needed, I didn't want to always remember my current branch name, as it often changes in my current workflow. – user1015214 May 02 '18 at 15:27
8

Follow-up @criswell

Funny, hg help log know nothing about "--only-branch" option, but note -b|--branch BRANCHNAME Also, for worst cases, branch() function in revsets

Lazy Badger
  • 94,711
  • 9
  • 78
  • 110
  • Yeah `--branch my_branch_name` worked for what I needed it for. I assumed it was a type-o There is no only command in mercurial. – themaniac27 Oct 19 '12 at 12:00