commands: incoming/outgoing with --no-merges should indicate end of output

timeless timeless at gmail.com
Thu Jun 10 09:22:49 CDT 2010


This makes understanding output in MacHg easier....

# HG changeset patch
# User timeless <timeless at gmail.com>
# Date 1276179325 -10800
# Node ID f5ee6fc7bc9f1aa8ade83193921d1a4a2adf164f
# Parent  3d6915f5a2bb02c2cf889c07c1821565069d1317
commands: incoming/outgoing with --no-merges should indicate end of output

diff --git a/mercurial/commands.py b/mercurial/commands.py
--- a/mercurial/commands.py
+++ b/mercurial/commands.py
@@ -2187,6 +2187,8 @@ def incoming(ui, repo, source="default",
                 continue
             count += 1
             displayer.show(other[n])
+        if count == 0:
+            ui.status(_("no matching changes found\n"))
         displayer.close()
     finally:
         if hasattr(other, 'close'):
@@ -2464,6 +2466,8 @@ def outgoing(ui, repo, dest=None, **opts
             continue
         count += 1
         displayer.show(repo[n])
+    if count == 0:
+        ui.status(_("no matching changes found\n"))
     displayer.close()

 def parents(ui, repo, file_=None, **opts):
diff --git a/tests/test-incoming-outgoing b/tests/test-incoming-outgoing
--- a/tests/test-incoming-outgoing
+++ b/tests/test-incoming-outgoing
@@ -52,3 +52,23 @@ echo "% limit to 3 changesets"
 hg -R test-dev outgoing -l 3 test
 hg -R test-dev outgoing http://localhost:$HGPORT/ | sed -e
"s,:$HGPORT/,:\$HGPORT/,"
 hg -R test-dev outgoing -r 11 http://localhost:$HGPORT/ | sed -e
"s,:$HGPORT/,:\$HGPORT/,"
+rm -r test test-dev
+
+# test --no-merges
+hg init test
+hg clone test test-out
+cd test
+echo 0 > foo
+hg commit -A -m init
+hg up -r null
+echo 1 > bar
+hg commit -A -m diverge
+hg incoming --no-merges -R ../test-out | sed -e "s,comparing with.*,comparing,"
+hg outgoing --no-merges ../test-out | sed -e "s,comparing with.*,comparing,"
+hg push ../test-out
+hg merge 0
+hg commit -m merging
+hg incoming --no-merges -R ../test-out | sed -e "s,comparing with.*,comparing,"
+hg outgoing --no-merges ../test-out | sed -e "s,comparing with.*,comparing,"
+cd ..
+rm -r test test-out
diff --git a/tests/test-incoming-outgoing.out b/tests/test-incoming-outgoing.out
--- a/tests/test-incoming-outgoing.out
+++ b/tests/test-incoming-outgoing.out
@@ -403,3 +403,50 @@ user:        test
 date:        Mon Jan 12 13:46:40 1970 +0000
 summary:     11

+updating to branch default
+0 files updated, 0 files merged, 0 files removed, 0 files unresolved
+adding foo
+0 files updated, 0 files merged, 1 files removed, 0 files unresolved
+adding bar
+created new head
+comparing
+changeset:   0:7fc19f854351
+user:        test
+date:        Thu Jan 01 00:00:00 1970 +0000
+summary:     init
+
+changeset:   1:09b2b7728047
+tag:         tip
+parent:      -1:000000000000
+user:        test
+date:        Thu Jan 01 00:00:00 1970 +0000
+summary:     diverge
+
+comparing
+searching for changes
+changeset:   0:7fc19f854351
+user:        test
+date:        Thu Jan 01 00:00:00 1970 +0000
+summary:     init
+
+changeset:   1:09b2b7728047
+tag:         tip
+parent:      -1:000000000000
+user:        test
+date:        Thu Jan 01 00:00:00 1970 +0000
+summary:     diverge
+
+pushing to ../test-out
+searching for changes
+adding changesets
+adding manifests
+adding file changes
+added 2 changesets with 2 changes to 2 files (+1 heads)
+1 files updated, 0 files merged, 0 files removed, 0 files unresolved
+(branch merge, don't forget to commit)
+comparing
+searching for changes
+no matching changes found
+comparing
+searching for changes
+no matching changes found


More information about the Mercurial-devel mailing list