atom feed9 messages in com.selenic.mercurial-devel[PATCH] bookmarks: add --only-bookmar...
FromSent OnAttachments
Alexander SolovyovDec 6, 2008 4:05 am 
David Soria ParraDec 6, 2008 6:19 am 
Benoit BoissinotDec 7, 2008 4:57 am 
David ShilvockDec 8, 2008 9:37 pm 
Alexander SolovyovDec 9, 2008 12:56 am 
Peter ArrenbrechtDec 9, 2008 7:27 am 
David Soria ParraDec 9, 2008 10:43 am 
David ShilvockDec 9, 2008 9:52 pm 
Peter ArrenbrechtDec 9, 2008 9:55 pm 
Subject:[PATCH] bookmarks: add --only-bookmark option to log
From:Alexander Solovyov (pira@piranha.org.ua)
Date:Dec 6, 2008 4:05:50 am
List:com.selenic.mercurial-devel

# HG changeset patch # User Alexander Solovyov <pira@piranha.org.ua> # Date 1228565010 -7200 # Node ID 5739457bd2d8053736b56e5a1bd3c7ed901648c2 # Parent 5f681a143eded72d4bf9b95682ecffc46460da74 bookmarks: add --only-bookmark option to log

diff --git a/hgext/bookmarks.py b/hgext/bookmarks.py --- a/hgext/bookmarks.py +++ b/hgext/bookmarks.py @@ -312,12 +312,27 @@ setcurrent(repo, rev) return res

+def bookmarkonlylog(orig, ui, repo, *args, **opts): + 'Show revisions that are ancestors of given bookmark' + if opts.get('only_bookmark'): + if opts.get('rev'): + raise util.Abort(_("you cannot use --rev and --only-bookmark" + " options simultaneously")) + mark = opts['only_bookmark'] + if not mark in parse(repo): + raise util.Abort(_("invalid bookmark name")) + opts['rev'] = ['%s:null' % mark] + orig(ui, repo, *args, **opts) + def uisetup(ui): 'Replace push with a decorator to provide --non-bookmarked option' entry = extensions.wrapcommand(commands.table, 'push', pushnonbookmarked) entry[1].append(('', 'non-bookmarked', None, _("push all heads that are not
bookmarked"))) if ui.configbool('bookmarks', 'track.current'): extensions.wrapcommand(commands.table, 'update', updatecurbookmark) + entry = extensions.wrapcommand(commands.table, 'log', bookmarkonlylog) + entry[1].append(('B', 'only-bookmark', '', + _("show only ancestors of given bookmark")))

cmdtable = { "bookmarks":