# HG changeset patch
# User Boris Feld
# Date 1535586801 -7200
# Thu Aug 30 01:53:21 2018 +0200
# Node ID 5f931c1d1422e9a8c08cca3a59804b25a1183449
# Parent ab452995eafffa69c34e863e4d8c03e163d8f3ad
# EXP-Topic phase-report
# Available At https://bitbucket.org/octobus/mercurial-devel/
# hg pull https://bitbucket.org/octobus/mercurial-devel/ -r
5f931c1d1422
phase: report number of non-public changeset alongside the new range
When interacting with non-publishing repository or bundle, it is useful to
have some information about the phase of the changeset we just pulled.
This changeset updates the "new changesets MIN:MAX" output to also includes
phases information for non-public changesets. Displaying extra data about
non-public changesets means the output for exchange with publishing repository
(the default) is unaffected.
diff --git a/mercurial/scmutil.py b/mercurial/scmutil.py
--- a/mercurial/scmutil.py
+++ b/mercurial/scmutil.py
@@ -1634,7 +1634,20 @@ def registersummarycallback(repo, otr, t
revrange = minrev
else:
revrange = '%s:%s' % (minrev, maxrev)
-repo.ui.status(_('new changesets %s\n') % revrange)
+draft = len(repo.revs('%ld and draft()', revs))
+secret = len(repo.revs('%ld and secret()', revs))
+if not (draft or secret):
+msg = _('new changesets %s\n') % revrange
+elif draft and secret:
+msg = _('new changesets %s (%d drafts, %d secrets)\n')
+msg %= (revrange, draft, secret)
+elif draft:
+msg = _('new changesets %s (%d drafts)\n')
+msg %= (revrange, draft)
+elif secret:
+msg = _('new changesets %s (%d secrets)\n')
+msg %= (revrange, secret)
+repo.ui.status(msg)
@reportsummary
def reportphasechanges(repo, tr):
diff --git a/tests/test-audit-path.t b/tests/test-audit-path.t
--- a/tests/test-audit-path.t
+++ b/tests/test-audit-path.t
@@ -82,7 +82,7 @@ unbundle tampered bundle
adding manifests
adding file changes
added 5 changesets with 6 changes to 6 files (+4 heads)
- new changesets b7da9bf6b037:fc1393d727bc
+ new changesets b7da9bf6b037:fc1393d727bc (5 drafts)
(run 'hg heads' to see heads, 'hg merge' to merge)
attack .hg/test
diff --git a/tests/test-bookmarks-pushpull.t b/tests/test-bookmarks-pushpull.t
--- a/tests/test-bookmarks-pushpull.t
+++ b/tests/test-bookmarks-pushpull.t
@@ -55,7 +55,7 @@ import bookmark by name
adding remote bookmark X
updating bookmark Y
adding remote bookmark Z
- new changesets 4e3505fd9583
+ new changesets 4e3505fd9583 (1 drafts)
test-hook-bookmark: X: -> 4e3505fd95835d721066b76e75dbb8cc554d7f77
test-hook-bookmark: Y: ->
4e3505fd95835d721066b76e75dbb8cc554d7f77
test-hook-bookmark: Z: -> 4e3505fd95835d721066b76e75dbb8cc554d7f77
@@ -418,7 +418,7 @@ divergent bookmarks
divergent bookmark @ stored as @foo
divergent bookmark X stored as X@foo
updating bookmark Z
- new changesets 0d2164f0ce0d
+ new changesets 0d2164f0ce0d (1 drafts)
test-hook-bookmark: @foo: -> 0d2164f0ce0d8f1d6f94351eba04b794909be66c
test-hook-bookmark: X@foo: -> 0d2164f0ce0d8f1d6f94351eba04b794909be66c
test-hook-bookmark: Z: 4e3505fd95835d721066b76e75dbb8cc554d7f77 ->
0d2164f0ce0d8f1d6f94351eba04b794909be66c
@@ -582,7 +582,7 @@ race conditions
adding file changes
added 1 changesets with 1 changes to 1 files
updating bookmark Y
- new changesets b0a5eff05604
+ new changesets b0a5eff05604 (1 drafts)
(run 'hg update' to get a working copy)
$ hg book
* @ 1:0d2164f0ce0d
@@ -632,7 +632,7 @@ Update a bookmark right after the initia
adding file changes
added 1 changesets with 1 changes to 1 files
updating bookmark Y
- new changesets 35d1ef0a8d1b
+ new changesets 35d1ef0a8d1b (1 drafts)
(run 'hg update' to get a working copy)
$ hg book
@ 1:0d2164f0ce0d
@@ -796,7 +796,7 @@ hgweb
adding file changes
added 5 changesets with 5 changes to 3 files (+2 heads)
2 new obsolescence markers
- new changesets 4e3505fd9583:c922c0139ca0
+ new changesets 4e3505fd9583:c922c0139ca0 (5 drafts)
updating to bookmark @
2 files updated, 0 files merged, 0 files removed, 0 files unresolved
$ hg -R cloned-bookmarks bookmarks
@@ -933,7 +933,7 @@ bookmark, not all outgoing changes:
adding file changes
added 5 changesets with 5 changes to 3 files (+2 heads)
2 new obsolescence markers
- new changesets 4e3505fd9583:c922c0139ca0
+ new changesets 4e3505fd9583:c922c0139ca0 (5 drafts)
updating to bookmark @
2 files updated, 0 files merged, 0 files removed, 0 files unresolved
$ cd addmarks
@@ -1225,7 +1225,7 @@ Test that pre-pushkey compat for bookmar
adding manifests
adding file changes
added 1 changesets with 1