diff mercurial/commands.py @ 1731:251729df9cc6

add -p option to tip. for issue 64.
author Vadim Gelfer <vadim.gelfer@gmail.com>
date Wed, 15 Feb 2006 11:05:43 -0800
parents 9b92b71d5dd7
children d3e6da334b85
line wrap: on
line diff
--- a/mercurial/commands.py	Wed Feb 15 10:49:30 2006 -0800
+++ b/mercurial/commands.py	Wed Feb 15 11:05:43 2006 -0800
@@ -2155,13 +2155,15 @@
             r = "    ?:?"
         ui.write("%-30s %s\n" % (t, r))
 
-def tip(ui, repo):
+def tip(ui, repo, **opts):
     """show the tip revision
 
     Show the tip revision.
     """
     n = repo.changelog.tip()
     show_changeset(ui, repo, changenode=n)
+    if opts['patch']:
+        dodiff(ui, ui, repo, repo.changelog.parents(n)[0], n)
 
 def unbundle(ui, repo, fname, **opts):
     """apply a changegroup file
@@ -2500,7 +2502,7 @@
           ('r', 'rev', '', _('revision to tag'))],
          _('hg tag [-r REV] [OPTION]... NAME')),
     "tags": (tags, [], _('hg tags')),
-    "tip": (tip, [], _('hg tip')),
+    "tip": (tip, [('p', 'patch', None, _('show patch'))], _('hg tip')),
     "unbundle":
         (unbundle,
          [('u', 'update', None,