Mercurial > public > mercurial-scm > hg
comparison mercurial/commands.py @ 1187:120aa5fc7ced
From mercurial-bounces@selenic.com Thu Sep 1 07:01:32 2005
Return-Path: <mercurial-bounces@selenic.com>
X-Original-To: bos@serpentine.com
Delivered-To: bos@serpentine.com
Received: from waste.org (waste.org [216.27.176.166]) by
demesne.serpentine.com (Postfix) with ESMTP id 3616A20B571 for
<bos@serpentine.com>; Thu, 1 Sep 2005 07:01:32 -0700 (PDT)
Received: from waste.org (localhost [127.0.0.1]) by waste.org
(8.13.4/8.13.4/Debian-3) with ESMTP id j81DxodQ028829; Thu, 1 Sep 2005
08:59:51 -0500
Received: from web32904.mail.mud.yahoo.com (web32904.mail.mud.yahoo.com
[68.142.206.51]) by waste.org (8.13.4/8.13.4/Debian-3) with SMTP id
j81DxnNA028824 for <mercurial@selenic.com>; Thu, 1 Sep 2005 08:59:49 -0500
Received: (qmail 25859 invoked by uid 60001); 1 Sep 2005 13:59:17 -0000
DomainKey-Signature: a=rsa-sha1; q=dns; c=nofws; s=s1024; d=yahoo.com;
h=Message-ID:Received:Date:From:Subject:To:In-Reply-To:MIME-Version:Content-Type:Content-Transfer-Encoding;
b=O6sELrlCknW3M/gKVqijWs82e/CbDEum1sEitcuLKXaP9dHU175PszOqMgcSKykMY+BVXtcH3NeaXLM3FyBmqNkoPAvesezyFbgQsHSM1S028oOexybCKMvtGQJmz66hzd1fDb0QoPj1gCcGU2VDevQaOesSmo1xF9jJwy2LlLE=
;
Message-ID: <20050901135917.25856.qmail@web32904.mail.mud.yahoo.com>
Received: from [60.48.222.94] by web32904.mail.mud.yahoo.com via HTTP; Thu,
01 Sep 2005 06:59:17 PDT
Date: Thu, 1 Sep 2005 06:59:17 -0700 (PDT)
From: TK Soh <teekaysoh@yahoo.com>
To: mercurial@selenic.com
In-Reply-To: <20050828075808.GO27787@waste.org>
MIME-Version: 1.0
Content-Type: text/plain; charset=iso-8859-1
X-Virus-Scanned: by amavisd-new
Subject: Re: add -p to hg tip
X-BeenThere: mercurial@selenic.com
X-Mailman-Version: 2.1.5
Precedence: list
List-Id: mercurial.selenic.com
List-Unsubscribe: <http://selenic.com/mailman/listinfo/mercurial>,
<mailto:mercurial-request@selenic.com?subject=unsubscribe>
List-Archive: <http://www.selenic.com/pipermail/mercurial>
List-Post: <mailto:mercurial@selenic.com>
List-Help: <mailto:mercurial-request@selenic.com?subject=help>
List-Subscribe: <http://selenic.com/mailman/listinfo/mercurial>,
<mailto:mercurial-request@selenic.com?subject=subscribe>
Sender: mercurial-bounces@selenic.com
Errors-To: mercurial-bounces@selenic.com
X-Spam-Checker-Version: SpamAssassin 3.0.4 (2005-06-05) on
demesne.serpentine.com
X-Spam-Level:
X-Spam-Status: No, score=-1.6 required=5.0 tests=AWL,BAYES_00 autolearn=ham
version=3.0.4
X-Evolution-Source: imap://bos@www.serpentine.com/
Content-Transfer-Encoding: 8bit
author | bos@serpentine.internal.keyresearch.com |
---|---|
date | Thu, 01 Sep 2005 07:47:26 -0700 |
parents | 862f53c1d0f9 |
children | b3ceb2d470fc |
comparison
equal
deleted
inserted
replaced
1186:508c7d1b3e1c | 1187:120aa5fc7ced |
---|---|
1056 | 1056 |
1057 if len(files) > 0: | 1057 if len(files) > 0: |
1058 addremove(ui, repo, *files) | 1058 addremove(ui, repo, *files) |
1059 repo.commit(files, message, user) | 1059 repo.commit(files, message, user) |
1060 | 1060 |
1061 def incoming(ui, repo, source="default"): | 1061 def incoming(ui, repo, source="default", **opts): |
1062 """show new changesets found in source""" | 1062 """show new changesets found in source""" |
1063 source = ui.expandpath(source) | 1063 source = ui.expandpath(source) |
1064 other = hg.repository(ui, source) | 1064 other = hg.repository(ui, source) |
1065 if not other.local(): | 1065 if not other.local(): |
1066 ui.warn("abort: incoming doesn't work for remote" | 1066 ui.warn("abort: incoming doesn't work for remote" |
1071 return | 1071 return |
1072 o = other.newer(o) | 1072 o = other.newer(o) |
1073 o.reverse() | 1073 o.reverse() |
1074 for n in o: | 1074 for n in o: |
1075 show_changeset(ui, other, changenode=n) | 1075 show_changeset(ui, other, changenode=n) |
1076 if opts['patch']: | |
1077 prev = other.changelog.parents(n)[0] | |
1078 dodiff(ui, ui, other, prev, n) | |
1079 ui.write("\n") | |
1076 | 1080 |
1077 def init(ui, dest="."): | 1081 def init(ui, dest="."): |
1078 """create a new repository in the given directory""" | 1082 """create a new repository in the given directory""" |
1079 if not os.path.exists(dest): | 1083 if not os.path.exists(dest): |
1080 os.mkdir(dest) | 1084 os.mkdir(dest) |
1152 files.sort() | 1156 files.sort() |
1153 | 1157 |
1154 for f in files: | 1158 for f in files: |
1155 ui.write("%40s %3s %s\n" % (hex(m[f]), mf[f] and "755" or "644", f)) | 1159 ui.write("%40s %3s %s\n" % (hex(m[f]), mf[f] and "755" or "644", f)) |
1156 | 1160 |
1157 def outgoing(ui, repo, dest="default-push"): | 1161 def outgoing(ui, repo, dest="default-push", **opts): |
1158 """show changesets not found in destination""" | 1162 """show changesets not found in destination""" |
1159 dest = ui.expandpath(dest) | 1163 dest = ui.expandpath(dest) |
1160 other = hg.repository(ui, dest) | 1164 other = hg.repository(ui, dest) |
1161 o = repo.findoutgoing(other) | 1165 o = repo.findoutgoing(other) |
1162 o = repo.newer(o) | 1166 o = repo.newer(o) |
1163 o.reverse() | 1167 o.reverse() |
1164 for n in o: | 1168 for n in o: |
1165 show_changeset(ui, repo, changenode=n) | 1169 show_changeset(ui, repo, changenode=n) |
1170 if opts['patch']: | |
1171 prev = repo.changelog.parents(n)[0] | |
1172 dodiff(ui, ui, repo, prev, n) | |
1173 ui.write("\n") | |
1166 | 1174 |
1167 def parents(ui, repo, rev=None): | 1175 def parents(ui, repo, rev=None): |
1168 """show the parents of the working dir or revision""" | 1176 """show the parents of the working dir or revision""" |
1169 if rev: | 1177 if rev: |
1170 p = repo.changelog.parents(repo.lookup(rev)) | 1178 p = repo.changelog.parents(repo.lookup(rev)) |
1639 (import_, | 1647 (import_, |
1640 [('p', 'strip', 1, 'path strip'), | 1648 [('p', 'strip', 1, 'path strip'), |
1641 ('f', 'force', None, 'skip check for outstanding changes'), | 1649 ('f', 'force', None, 'skip check for outstanding changes'), |
1642 ('b', 'base', "", 'base path')], | 1650 ('b', 'base', "", 'base path')], |
1643 "hg import [-f] [-p NUM] [-b BASE] PATCH..."), | 1651 "hg import [-f] [-p NUM] [-b BASE] PATCH..."), |
1644 "incoming|in": (incoming, [], 'hg incoming [SOURCE]'), | 1652 "incoming|in": (incoming, |
1653 [('p', 'patch', None, 'show patch')], | |
1654 'hg incoming [-p] [SOURCE]'), | |
1645 "^init": (init, [], 'hg init [DEST]'), | 1655 "^init": (init, [], 'hg init [DEST]'), |
1646 "locate": | 1656 "locate": |
1647 (locate, | 1657 (locate, |
1648 [('r', 'rev', '', 'revision'), | 1658 [('r', 'rev', '', 'revision'), |
1649 ('0', 'print0', None, 'end filenames with NUL'), | 1659 ('0', 'print0', None, 'end filenames with NUL'), |
1657 ('X', 'exclude', [], 'exclude path from search'), | 1667 ('X', 'exclude', [], 'exclude path from search'), |
1658 ('r', 'rev', [], 'revision'), | 1668 ('r', 'rev', [], 'revision'), |
1659 ('p', 'patch', None, 'show patch')], | 1669 ('p', 'patch', None, 'show patch')], |
1660 'hg log [-I] [-X] [-r REV]... [-p] [FILE]'), | 1670 'hg log [-I] [-X] [-r REV]... [-p] [FILE]'), |
1661 "manifest": (manifest, [], 'hg manifest [REV]'), | 1671 "manifest": (manifest, [], 'hg manifest [REV]'), |
1662 "outgoing|out": (outgoing, [], 'hg outgoing [DEST]'), | 1672 "outgoing|out": (outgoing, |
1673 [('p', 'patch', None, 'show patch')], | |
1674 'hg outgoing [-p] [DEST]'), | |
1663 "parents": (parents, [], 'hg parents [REV]'), | 1675 "parents": (parents, [], 'hg parents [REV]'), |
1664 "paths": (paths, [], 'hg paths [NAME]'), | 1676 "paths": (paths, [], 'hg paths [NAME]'), |
1665 "^pull": | 1677 "^pull": |
1666 (pull, | 1678 (pull, |
1667 [('u', 'update', None, 'update working directory'), | 1679 [('u', 'update', None, 'update working directory'), |