add -p option to tip. for issue 64.
authorVadim Gelfer <vadim.gelfer@gmail.com>
Wed, 15 Feb 2006 11:05:43 -0800
changeset 1731 251729df9cc6
parent 1730 0f1d2c75db5e
child 1732 d3e6da334b85
add -p option to tip. for issue 64.
doc/hg.1.txt
mercurial/commands.py
--- a/doc/hg.1.txt	Wed Feb 15 10:49:30 2006 -0800
+++ b/doc/hg.1.txt	Wed Feb 15 11:05:43 2006 -0800
@@ -602,9 +602,12 @@
 
     This lists both regular and local tags.
 
-tip::
+tip [-p]::
     Show the tip revision.
 
+    options:
+    -p, --patch      show patch
+
 unbundle <file>::
     (EXPERIMENTAL)
 
--- 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,