changeset 927:5a830d7bea52

Add hg incoming command for local repositories
author mpm@selenic.com
date Tue, 16 Aug 2005 19:17:16 -0800
parents b765e970c9ff
children 6f2c3bcbfaaf
files mercurial/commands.py
diffstat 1 files changed, 15 insertions(+), 0 deletions(-) [+]
line wrap: on
line diff
--- a/mercurial/commands.py	Tue Aug 16 19:17:01 2005 -0800
+++ b/mercurial/commands.py	Tue Aug 16 19:17:16 2005 -0800
@@ -782,6 +782,20 @@
             addremove(ui, repo, *files)
         repo.commit(files, message, user)
 
+def incoming(ui, repo, source="default"):
+    """show changesets not found in source"""
+    source = ui.expandpath(source)
+    other = hg.repository(ui, source)
+    if not other.local():
+        ui.warn("abort: incoming doesn't work for remote"
+                + " repositories yet, sorry!\n")
+        return 1
+    o = repo.findincoming(other)
+    o = other.newer(o)
+    o.reverse()
+    for n in o:
+        show_changeset(ui, other, changenode=n)
+
 def init(ui, dest="."):
     """create a new repository in the given directory"""
     if not os.path.exists(dest):
@@ -1303,6 +1317,7 @@
          [('p', 'strip', 1, 'path strip'),
           ('b', 'base', "", 'base path')],
          "hg import [-p NUM] [-b BASE] PATCH..."),
+    "incoming": (incoming, [], 'hg incoming [SOURCE]'),
     "^init": (init, [], 'hg init [DEST]'),
     "locate":
         (locate,