comparison mercurial/commands.py @ 927:5a830d7bea52

Add hg incoming command for local repositories
author mpm@selenic.com
date Tue, 16 Aug 2005 19:17:16 -0800
parents ab681ea2857e
children 6f2c3bcbfaaf
comparison
equal deleted inserted replaced
926:b765e970c9ff 927:5a830d7bea52
779 raise util.Abort("patch failed") 779 raise util.Abort("patch failed")
780 780
781 if len(files) > 0: 781 if len(files) > 0:
782 addremove(ui, repo, *files) 782 addremove(ui, repo, *files)
783 repo.commit(files, message, user) 783 repo.commit(files, message, user)
784
785 def incoming(ui, repo, source="default"):
786 """show changesets not found in source"""
787 source = ui.expandpath(source)
788 other = hg.repository(ui, source)
789 if not other.local():
790 ui.warn("abort: incoming doesn't work for remote"
791 + " repositories yet, sorry!\n")
792 return 1
793 o = repo.findincoming(other)
794 o = other.newer(o)
795 o.reverse()
796 for n in o:
797 show_changeset(ui, other, changenode=n)
784 798
785 def init(ui, dest="."): 799 def init(ui, dest="."):
786 """create a new repository in the given directory""" 800 """create a new repository in the given directory"""
787 if not os.path.exists(dest): 801 if not os.path.exists(dest):
788 os.mkdir(dest) 802 os.mkdir(dest)
1301 "import|patch": 1315 "import|patch":
1302 (import_, 1316 (import_,
1303 [('p', 'strip', 1, 'path strip'), 1317 [('p', 'strip', 1, 'path strip'),
1304 ('b', 'base', "", 'base path')], 1318 ('b', 'base', "", 'base path')],
1305 "hg import [-p NUM] [-b BASE] PATCH..."), 1319 "hg import [-p NUM] [-b BASE] PATCH..."),
1320 "incoming": (incoming, [], 'hg incoming [SOURCE]'),
1306 "^init": (init, [], 'hg init [DEST]'), 1321 "^init": (init, [], 'hg init [DEST]'),
1307 "locate": 1322 "locate":
1308 (locate, 1323 (locate,
1309 [('r', 'rev', '', 'revision'), 1324 [('r', 'rev', '', 'revision'),
1310 ('0', 'print0', None, 'end records with NUL'), 1325 ('0', 'print0', None, 'end records with NUL'),