add -p to hg tip
TK Soh
teekaysoh at yahoo.com
Thu Sep 1 08:59:17 CDT 2005
--- Matt Mackall <mpm at selenic.com> wrote:
> I don't think we should add -p everywhere. It exists for doing review.
> It _does_ make sense to add it to incoming/outgoing though.
# HG changeset patch
# User TK Soh <teekaysoh at yahoo.com>
# Node ID 2aa086274b3a88645aa7a5f0f95e054d480fff1c
# Parent a33a7a543803c7383a6918b19797bf9fd6b83e8e
Add -p to incoming and outgoing commands to show patch
diff -r a33a7a543803 -r 2aa086274b3a doc/hg.1.txt
--- a/doc/hg.1.txt Sun Aug 28 06:45:27 2005
+++ b/doc/hg.1.txt Thu Sep 1 13:55:07 2005
@@ -234,12 +234,15 @@
aliases: patch
-incoming [source]::
+incoming [-p] [source]::
Show new changesets found in the specified repo or the default
pull repo. These are the changesets that would be pulled if a pull
was requested.
Currently only local repositories are supported.
+
+ options:
+ -p, --patch show patch
aliases: in
@@ -295,10 +298,13 @@
The manifest is the list of files being version controlled. If no revision
is given then the tip is used.
-outgoing [dest]::
+outgoing [-p] [dest]::
Show changesets not found in the specified destination repo or the
default push repo. These are the changesets that would be pushed
if a push was requested.
+
+ options:
+ -p, --patch show patch
aliases: out
diff -r a33a7a543803 -r 2aa086274b3a mercurial/commands.py
--- a/mercurial/commands.py Sun Aug 28 06:45:27 2005
+++ b/mercurial/commands.py Thu Sep 1 13:55:07 2005
@@ -1005,7 +1005,7 @@
addremove(ui, repo, *files)
repo.commit(files, message, user)
-def incoming(ui, repo, source="default"):
+def incoming(ui, repo, source="default", **opts):
"""show new changesets found in source"""
source = ui.expandpath(source)
other = hg.repository(ui, source)
@@ -1020,6 +1020,10 @@
o.reverse()
for n in o:
show_changeset(ui, other, changenode=n)
+ if opts['patch']:
+ prev = other.changelog.parents(n)[0]
+ dodiff(ui, ui, other, prev, n)
+ ui.write("\n")
def init(ui, dest="."):
"""create a new repository in the given directory"""
@@ -1100,7 +1104,7 @@
for f in files:
ui.write("%40s %3s %s\n" % (hex(m[f]), mf[f] and "755" or "644", f))
-def outgoing(ui, repo, dest="default-push"):
+def outgoing(ui, repo, dest="default-push", **opts):
"""show changesets not found in destination"""
dest = ui.expandpath(dest)
other = hg.repository(ui, dest)
@@ -1109,6 +1113,10 @@
o.reverse()
for n in o:
show_changeset(ui, repo, changenode=n)
+ if opts['patch']:
+ prev = repo.changelog.parents(n)[0]
+ dodiff(ui, ui, repo, prev, n)
+ ui.write("\n")
def parents(ui, repo, rev=None):
"""show the parents of the working dir or revision"""
@@ -1582,7 +1590,9 @@
('f', 'force', None, 'skip check for outstanding changes'),
('b', 'base', "", 'base path')],
"hg import [-f] [-p NUM] [-b BASE] PATCH..."),
- "incoming|in": (incoming, [], 'hg incoming [SOURCE]'),
+ "incoming|in": (incoming,
+ [('p', 'patch', None, 'show patch')],
+ 'hg incoming [-p] [SOURCE]'),
"^init": (init, [], 'hg init [DEST]'),
"locate":
(locate,
@@ -1600,7 +1610,9 @@
('p', 'patch', None, 'show patch')],
'hg log [-I] [-X] [-r REV]... [-p] [FILE]'),
"manifest": (manifest, [], 'hg manifest [REV]'),
- "outgoing|out": (outgoing, [], 'hg outgoing [DEST]'),
+ "outgoing|out": (outgoing,
+ [('p', 'patch', None, 'show patch')],
+ 'hg outgoing [-p] [DEST]'),
"parents": (parents, [], 'hg parents [REV]'),
"paths": (paths, [], 'hg paths [NAME]'),
"^pull":
____________________________________________________
Start your day with Yahoo! - make it your home page
http://www.yahoo.com/r/hs
More information about the Mercurial
mailing list