Mercurial > public > mercurial-scm > hg-stable
comparison mercurial/commands.py @ 45915:0aa118f18d4b
log: add bookmark option to "hg log"
Before pushing a bookmark with "hg push origin -B 'my-topic'", it is useful to inspect
the list of commits that are ancestors of the bookmark.
By relying on scmutil.bookmarkrevs(), "hg log -B topic" has the same bookmark semantics
found in other commands like hg export, hg email, hg strip.
Differential Revision: https://phab.mercurial-scm.org/D9341
author | Sebastien Boisvert <sebhtml@protonmail.com> |
---|---|
date | Tue, 17 Nov 2020 21:30:50 -0500 |
parents | ac362d5a7893 |
children | e131dbf6ee15 |
comparison
equal
deleted
inserted
replaced
45914:f96059fa519c | 45915:0aa118f18d4b |
---|---|
4454 [], | 4454 [], |
4455 _(b'show changesets within the given named branch'), | 4455 _(b'show changesets within the given named branch'), |
4456 _(b'BRANCH'), | 4456 _(b'BRANCH'), |
4457 ), | 4457 ), |
4458 ( | 4458 ( |
4459 b'B', | |
4460 b'bookmark', | |
4461 [], | |
4462 _(b"show changesets within the given bookmark"), | |
4463 _(b'BOOKMARK'), | |
4464 ), | |
4465 ( | |
4459 b'P', | 4466 b'P', |
4460 b'prune', | 4467 b'prune', |
4461 [], | 4468 [], |
4462 _(b'do not display revision or any of its ancestors'), | 4469 _(b'do not display revision or any of its ancestors'), |
4463 _(b'REV'), | 4470 _(b'REV'), |
4611 raise error.InputError( | 4618 raise error.InputError( |
4612 _(b'FILE arguments are not compatible with --line-range option') | 4619 _(b'FILE arguments are not compatible with --line-range option') |
4613 ) | 4620 ) |
4614 | 4621 |
4615 repo = scmutil.unhidehashlikerevs(repo, opts.get(b'rev'), b'nowarn') | 4622 repo = scmutil.unhidehashlikerevs(repo, opts.get(b'rev'), b'nowarn') |
4616 revs, differ = logcmdutil.getrevs( | 4623 walk_opts = logcmdutil.parseopts(ui, pats, opts) |
4617 repo, logcmdutil.parseopts(ui, pats, opts) | 4624 revs, differ = logcmdutil.getrevs(repo, walk_opts) |
4618 ) | |
4619 if linerange: | 4625 if linerange: |
4620 # TODO: should follow file history from logcmdutil._initialrevs(), | 4626 # TODO: should follow file history from logcmdutil._initialrevs(), |
4621 # then filter the result by logcmdutil._makerevset() and --limit | 4627 # then filter the result by logcmdutil._makerevset() and --limit |
4622 revs, differ = logcmdutil.getlinerangerevs(repo, revs, opts) | 4628 revs, differ = logcmdutil.getlinerangerevs(repo, revs, opts) |
4629 | |
4630 if opts.get(b'bookmark'): | |
4631 cmdutil.check_at_most_one_arg(opts, b'rev', b'bookmark') | |
4632 bookmarks = opts.get(b'bookmark') | |
4633 bookmark = bookmarks[0] | |
4634 revs, differ = logcmdutil.get_bookmark_revs(repo, bookmark, walk_opts) | |
4623 | 4635 |
4624 getcopies = None | 4636 getcopies = None |
4625 if opts.get(b'copies'): | 4637 if opts.get(b'copies'): |
4626 endrev = None | 4638 endrev = None |
4627 if revs: | 4639 if revs: |