changeset 559:d4ccec82b816

push: suppress ref output by default When communicating with the user on push, Mercurial doesn't show much on success. Currently, Hg-Git shows every changed ref. After this change, the default output will more closely match Mercurial's regular behavior (no per-ref output), while changed refs will be shown if --verbose is specified, and all refs will be shown if --debug is specified.
author David M. Carr <david@carrclan.us>
date Thu, 25 Oct 2012 21:47:36 -0400
parents ab8061d9942b
children 9c71a6f00863
files hggit/git_handler.py tests/test-git-tags.t tests/test-hg-author.t tests/test-hg-branch.t tests/test-hg-tags.t tests/test-push.t tests/test-subrepos.t
diffstat 7 files changed, 4 insertions(+), 17 deletions(-) [+]
line wrap: on
line diff
--- a/hggit/git_handler.py
+++ b/hggit/git_handler.py
@@ -277,7 +277,10 @@
         if remote_name and new_refs:
             for ref, new_sha in new_refs.iteritems():
                 if new_sha != old_refs.get(ref):
-                    self.ui.status("    %s::%s => GIT:%s\n" %
+                    self.ui.note("    %s::%s => GIT:%s\n" %
+                                   (remote_name, ref, new_sha[0:8]))
+                else:
+                    self.ui.debug("    %s::%s => GIT:%s\n" %
                                    (remote_name, ref, new_sha[0:8]))
 
             self.update_remote_branches(remote_name, new_refs)
--- a/tests/test-git-tags.t
+++ b/tests/test-git-tags.t
@@ -73,6 +73,5 @@
   pushing to $TESTTMP/gitrepo
   exporting hg objects to git
   searching for changes
-      default::refs/heads/master => GIT:3b7fd1b3
 
   $ cd ..
--- a/tests/test-hg-author.t
+++ b/tests/test-hg-author.t
@@ -56,7 +56,6 @@
   pushing to $TESTTMP/gitrepo
   exporting hg objects to git
   searching for changes
-      default::refs/heads/master => GIT:cffa0e8d
 
   $ echo gamma >> beta
   $ hgcommit -u "test <test@example.com> (comment)" -m 'modify beta'
@@ -64,7 +63,6 @@
   pushing to $TESTTMP/gitrepo
   exporting hg objects to git
   searching for changes
-      default::refs/heads/master => GIT:2b9ec6a4
 
   $ echo gamma > gamma
   $ hg add gamma
@@ -73,7 +71,6 @@
   pushing to $TESTTMP/gitrepo
   exporting hg objects to git
   searching for changes
-      default::refs/heads/master => GIT:fee30180
 
   $ echo delta > delta
   $ hg add delta
@@ -82,7 +79,6 @@
   pushing to $TESTTMP/gitrepo
   exporting hg objects to git
   searching for changes
-      default::refs/heads/master => GIT:d1659250
 
   $ echo epsilon > epsilon
   $ hg add epsilon
@@ -91,7 +87,6 @@
   pushing to $TESTTMP/gitrepo
   exporting hg objects to git
   searching for changes
-      default::refs/heads/master => GIT:ee985f12
 
   $ echo zeta > zeta
   $ hg add zeta
@@ -100,7 +95,6 @@
   pushing to $TESTTMP/gitrepo
   exporting hg objects to git
   searching for changes
-      default::refs/heads/master => GIT:d21e26b4
 
   $ echo eta > eta
   $ hg add eta
@@ -109,7 +103,6 @@
   pushing to $TESTTMP/gitrepo
   exporting hg objects to git
   searching for changes
-      default::refs/heads/master => GIT:8c878c97
 
   $ echo theta > theta
   $ hg add theta
@@ -118,7 +111,6 @@
   pushing to $TESTTMP/gitrepo
   exporting hg objects to git
   searching for changes
-      default::refs/heads/master => GIT:1e03e913
 
   $ hg log --graph | egrep -v ': *(not-master|master)'
   @  changeset:   8:d3c51ce68cfd
--- a/tests/test-hg-branch.t
+++ b/tests/test-hg-branch.t
@@ -59,7 +59,6 @@
   pushing to $TESTTMP/gitrepo
   exporting hg objects to git
   searching for changes
-      default::refs/heads/master => GIT:05c2bcbe
 
   $ hg branch gamma | grep -v 'permanent and global'
   marked working directory as branch gamma
@@ -68,7 +67,6 @@
   pushing to $TESTTMP/gitrepo
   exporting hg objects to git
   searching for changes
-      default::refs/heads/master => GIT:296802ef
 
   $ hg log --graph | $filterhash | egrep -v ': *(not-master|master)'
   @  changeset:   2:05aed681ccb3
--- a/tests/test-hg-tags.t
+++ b/tests/test-hg-tags.t
@@ -54,8 +54,6 @@
   pushing to $TESTTMP/gitrepo
   exporting hg objects to git
   searching for changes
-      default::refs/tags/alpha => GIT:7eeab2ea
-      default::refs/heads/master => GIT:9a2616b9
 
   $ hg log --graph | egrep -v ': *(not-master|master)'
   @  changeset:   1:d529e9229f6d
--- a/tests/test-push.t
+++ b/tests/test-push.t
@@ -61,7 +61,6 @@
   pushing to $TESTTMP/gitrepo
   exporting hg objects to git
   searching for changes
-      default::refs/heads/beta => GIT:cffa0e8d
 
   $ cd ..
 
@@ -140,7 +139,6 @@
   $ hg push -fr master
   pushing to $TESTTMP/gitrepo
   searching for changes
-      default::refs/heads/master => GIT:cc119202
 
   $ echo % this should fail, no changes to push
   % this should fail, no changes to push
--- a/tests/test-subrepos.t
+++ b/tests/test-subrepos.t
@@ -117,7 +117,6 @@
   pushing to $TESTTMP/gitrepo1
   exporting hg objects to git
   searching for changes
-      default::refs/heads/master => GIT:4663c492
   $ cd ..
   $ cd gitrepo1
   $ echo % there shall be two gitlink entries, with values matching that in .hgsubstate