Add option -b/--branch to hg tip (as done for hg parents).
authorThomas Arendsen Hein <thomas@intevation.de>
Tue, 21 Feb 2006 12:59:16 +0100
changeset 1762 8eaa8e06a364
parent 1761 7eb1934f83fb
child 1763 fa34a74efc40
Add option -b/--branch to hg tip (as done for hg parents).
mercurial/commands.py
--- a/mercurial/commands.py	Tue Feb 21 08:11:46 2006 +0100
+++ b/mercurial/commands.py	Tue Feb 21 12:59:16 2006 +0100
@@ -2225,7 +2225,10 @@
     Show the tip revision.
     """
     n = repo.changelog.tip()
-    show_changeset(ui, repo, changenode=n)
+    br = None
+    if opts['branch']:
+        br = repo.branchlookup([n])
+    show_changeset(ui, repo, changenode=n, brinfo=br)
     if opts['patch']:
         dodiff(ui, ui, repo, repo.changelog.parents(n)[0], n)
 
@@ -2577,7 +2580,11 @@
           ('r', 'rev', '', _('revision to tag'))],
          _('hg tag [-r REV] [OPTION]... NAME')),
     "tags": (tags, [], _('hg tags')),
-    "tip": (tip, [('p', 'patch', None, _('show patch'))], _('hg tip')),
+    "tip":
+        (tip,
+         [('b', 'branch', None, _('show branches')),
+          ('p', 'patch', None, _('show patch'))],
+         _('hg [-b] [-p] tip')),
     "unbundle":
         (unbundle,
          [('u', 'update', None,