Patchwork D8973: log: add support for bookmarks

login
register
mail settings
Submitter phabricator
Date Aug. 31, 2020, 2:07 a.m.
Message ID <differential-rev-PHID-DREV-yv4wc742qhmmyqninji6-req@mercurial-scm.org>
Download mbox | patch
Permalink /patch/47074/
State Superseded
Headers show

Comments

phabricator - Aug. 31, 2020, 2:07 a.m.
sebhtml created this revision.
Herald added a reviewer: hg-reviewers.
Herald added a subscriber: mercurial-patches.

REVISION SUMMARY
  A bookmark can already be pushed with 'hg push origin -B topic-foo'.
  The pull command also supports bookmarks.
  
  This patch adds support for bookmarks using the '_opt2logrevset' code path.
  
  The list of changesets for a bookmark can now be obtained simply with:
  'hg log -B topic-foo'.
  
  Reviewed-by: Elenie Godzaridis <arangradient@gmail.com>

REPOSITORY
  rHG Mercurial

BRANCH
  sebhtml

REVISION DETAIL
  https://phab.mercurial-scm.org/D8973

AFFECTED FILES
  mercurial/commands.py
  mercurial/logcmdutil.py

CHANGE DETAILS




To: sebhtml, #hg-reviewers
Cc: mercurial-patches, mercurial-devel

Patch

diff --git a/mercurial/logcmdutil.py b/mercurial/logcmdutil.py
--- a/mercurial/logcmdutil.py
+++ b/mercurial/logcmdutil.py
@@ -774,6 +774,7 @@ 
     b'_matchfiles': (None, b'_matchfiles(%ps)'),
     b'date': (b'date(%s)', None),
     b'branch': (b'branch(%s)', b'%lr'),
+    b'bookmark': (b'reverse(ancestors(bookmark(%s)))', b'%lr'),
     b'_patslog': (b'filelog(%s)', b'%lr'),
     b'keyword': (b'keyword(%s)', b'%lr'),
     b'prune': (b'ancestors(%s)', b'not %lr'),
diff --git a/mercurial/commands.py b/mercurial/commands.py
--- a/mercurial/commands.py
+++ b/mercurial/commands.py
@@ -4556,6 +4556,12 @@ 
             _(b'BRANCH'),
         ),
         (
+            b'B',
+            b'bookmark',
+            [],
+            _(b"show changesets within the given bookmark"),
+            _(b'BOOKMARK')),
+        (
             b'P',
             b'prune',
             [],