comparison mercurial/commands.py @ 6068:ea33f695304a

Automated merge with http://hg.west.spy.net/hg/hacks/hg
author Bryan O'Sullivan <bos@serpentine.com>
date Sat, 09 Feb 2008 20:43:42 -0800
parents 218d5b9aa466 57c1a7052982
children f5b00b6e426a
comparison
equal deleted inserted replaced
6066:f3a8b5360100 6068:ea33f695304a
1711 1711
1712 df = False 1712 df = False
1713 if opts["date"]: 1713 if opts["date"]:
1714 df = util.matchdate(opts["date"]) 1714 df = util.matchdate(opts["date"])
1715 1715
1716 only_branches = opts['only_branch']
1717
1716 displayer = cmdutil.show_changeset(ui, repo, opts, True, matchfn) 1718 displayer = cmdutil.show_changeset(ui, repo, opts, True, matchfn)
1717 for st, rev, fns in changeiter: 1719 for st, rev, fns in changeiter:
1718 if st == 'add': 1720 if st == 'add':
1719 changenode = repo.changelog.node(rev) 1721 changenode = repo.changelog.node(rev)
1720 parents = [p for p in repo.changelog.parentrevs(rev) 1722 parents = [p for p in repo.changelog.parentrevs(rev)
1721 if p != nullrev] 1723 if p != nullrev]
1722 if opts['no_merges'] and len(parents) == 2: 1724 if opts['no_merges'] and len(parents) == 2:
1723 continue 1725 continue
1724 if opts['only_merges'] and len(parents) != 2: 1726 if opts['only_merges'] and len(parents) != 2:
1725 continue 1727 continue
1728
1729 if only_branches:
1730 revbranch = get(rev)[5]['branch']
1731 if revbranch not in only_branches:
1732 continue
1726 1733
1727 if df: 1734 if df:
1728 changes = get(rev) 1735 changes = get(rev)
1729 if not df(changes[2][0]): 1736 if not df(changes[2][0]):
1730 continue 1737 continue
2928 ('r', 'rev', [], _('show the specified revision or range')), 2935 ('r', 'rev', [], _('show the specified revision or range')),
2929 ('', 'removed', None, _('include revs where files were removed')), 2936 ('', 'removed', None, _('include revs where files were removed')),
2930 ('M', 'no-merges', None, _('do not show merges')), 2937 ('M', 'no-merges', None, _('do not show merges')),
2931 ('', 'style', '', _('display using template map file')), 2938 ('', 'style', '', _('display using template map file')),
2932 ('m', 'only-merges', None, _('show only merges')), 2939 ('m', 'only-merges', None, _('show only merges')),
2940 ('b', 'only-branch', [],
2941 _('show only changesets within the given named branch')),
2933 ('p', 'patch', None, _('show patch')), 2942 ('p', 'patch', None, _('show patch')),
2934 ('P', 'prune', [], _('do not display revision or any of its ancestors')), 2943 ('P', 'prune', [], _('do not display revision or any of its ancestors')),
2935 ('', 'template', '', _('display with template')), 2944 ('', 'template', '', _('display with template')),
2936 ] + walkopts, 2945 ] + walkopts,
2937 _('hg log [OPTION]... [FILE]')), 2946 _('hg log [OPTION]... [FILE]')),