add -p option to tip. for issue 64.
--- 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,