pushlog: only print lack of pushlog recording in verbose mode (
bug 1296137); r?glandium
The logged message is just positive confirmation that the extension is
working as advertised. We should be testing for behavior, not logged
messages.
Change the message so it is only printed in verbose mode.
MozReview-Commit-ID: BdtwR0jWbEf
--- a/hgext/pushlog/__init__.py
+++ b/hgext/pushlog/__init__.py
@@ -521,17 +521,17 @@ def pretxnchangegrouphook(ui, repo, node
# new changesets unless they come from a push. ``source`` can be
# ``push`` for ssh or ``serve`` for HTTP pushes.
#
# This is arguably the wrong thing to do: designing a system to record
# all changes to the store is the right thing to do. However, things are
# like this for backwards compatibility with the original intent of
# pushlog.
if source not in ('push', 'serve'):
- ui.status('(not updating pushlog since changesets come from %s)\n' % source)
+ ui.note('(not updating pushlog since changesets come from %s)\n' % source)
return 0
# REMOTE_USER comes from authenticated Apache httpd request.
# USER comes from SSH.
# Both are implicitly trusted.
# Since the usernames could come from separate auth databases, we support
# prefixing the user with an identifier to distinguish which source the
# user came from.
--- a/hgext/pushlog/tests/test-pull.t
+++ b/hgext/pushlog/tests/test-pull.t
@@ -63,17 +63,16 @@ Pulling from a remote that has pushlog w
$ cd client
$ hg pull http://localhost:$HGPORT
pulling from http://localhost:$HGPORT/
searching for changes
adding changesets
adding manifests
adding file changes
added 3 changesets with 3 changes to 1 files
- (not updating pushlog since changesets come from pull)
added 2 pushes
(run 'hg update' to get a working copy)
$ dumppushlog client
ID: 1; user: hguser; Date: \d+; Rev: 0; Node: 96ee1d7354c4ad7372047672c36a1f561e3a6a4c (re)
ID: 2; user: hguser; Date: \d+; Rev: 1; Node: d0fddd3a3fb51076c33010ecf66692621f989a2c (re)
ID: 3; user: hguser; Date: \d+; Rev: 2; Node: 53532d3f0b038c6e7bf435c45f28c1be1ab97049 (re)
ID: 3; user: hguser; Date: \d+; Rev: 3; Node: 77a9042f9fafe759713d8e76d027e55fee784512 (re)
@@ -108,17 +107,16 @@ Incremental pushlog fetch works over SSH
$ cd ../clone-ssh
$ hg --config extensions.pushlog=$TESTDIR/hgext/pushlog pull
pulling from ssh://user@dummy/$TESTTMP/server
searching for changes
adding changesets
adding manifests
adding file changes
added 1 changesets with 1 changes to 1 files
- (not updating pushlog since changesets come from pull)
added 1 pushes
(run 'hg update' to get a working copy)
$ dumppushlog clone-ssh
ID: 1; user: hguser; Date: \d+; Rev: 0; Node: 96ee1d7354c4ad7372047672c36a1f561e3a6a4c (re)
ID: 2; user: hguser; Date: \d+; Rev: 1; Node: d0fddd3a3fb51076c33010ecf66692621f989a2c (re)
ID: 3; user: hguser; Date: \d+; Rev: 2; Node: 53532d3f0b038c6e7bf435c45f28c1be1ab97049 (re)
ID: 3; user: hguser; Date: \d+; Rev: 3; Node: 77a9042f9fafe759713d8e76d027e55fee784512 (re)
@@ -139,29 +137,27 @@ Pulling an old changeset only pulls rele
$ cd ../clone-ssh
$ hg --config extensions.pushlog=$TESTDIR/hgext/pushlog pull -r 1a68e4eb4da6
pulling from ssh://user@dummy/$TESTTMP/server
searching for changes
adding changesets
adding manifests
adding file changes
added 1 changesets with 1 changes to 1 files
- (not updating pushlog since changesets come from pull)
received pushlog entry for unknown changeset; ignoring
added 1 pushes
(run 'hg update' to get a working copy)
$ hg --config extensions.pushlog=$TESTDIR/hgext/pushlog pull
pulling from ssh://user@dummy/$TESTTMP/server
searching for changes
adding changesets
adding manifests
adding file changes
added 1 changesets with 1 changes to 1 files
- (not updating pushlog since changesets come from pull)
added 1 pushes
(run 'hg update' to get a working copy)
$ dumppushlog clone-ssh
ID: 1; user: hguser; Date: \d+; Rev: 0; Node: 96ee1d7354c4ad7372047672c36a1f561e3a6a4c (re)
ID: 2; user: hguser; Date: \d+; Rev: 1; Node: d0fddd3a3fb51076c33010ecf66692621f989a2c (re)
ID: 3; user: hguser; Date: \d+; Rev: 2; Node: 53532d3f0b038c6e7bf435c45f28c1be1ab97049 (re)
ID: 3; user: hguser; Date: \d+; Rev: 3; Node: 77a9042f9fafe759713d8e76d027e55fee784512 (re)
--- a/hgext/pushlog/tests/test-sources.t
+++ b/hgext/pushlog/tests/test-sources.t
@@ -12,21 +12,27 @@
$ hg commit -A -m 'initial'
adding foo
$ hg push ../server > /dev/null
$ cd ..
Introducing changesets via pulling does not run the pushlog hook
$ cd client2
- $ hg pull
+ $ hg --verbose pull
pulling from $TESTTMP/server
requesting all changes
+ 1 changesets found
+ uncompressed size of bundle content:
+ 182 (changelog)
+ 165 (manifests)
+ 115 foo
adding changesets
adding manifests
adding file changes
added 1 changesets with 1 changes to 1 files
+ calling hook pretxnchangegroup.pushlog: hgext_pushlog.pretxnchangegrouphook
(not updating pushlog since changesets come from pull)
(run 'hg update' to get a working copy)
$ dumppushlog client2
pushlog database does not exist: $TESTTMP/client2/.hg/pushlog2.db
[1]