# HG changeset patch # User mpm@selenic.com # Date 1124248636 28800 # Node ID 5a830d7bea5239d8475807abbb2bd7a0791d1780 # Parent b765e970c9ff3dfa72d3d30130513a23bdec776e Add hg incoming command for local repositories diff --git a/mercurial/commands.py b/mercurial/commands.py --- a/mercurial/commands.py +++ b/mercurial/commands.py @@ -782,6 +782,20 @@ def import_(ui, repo, patch1, *patches, 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 @@ table = { [('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,