transaction-summary: show phase changes statistics in pull/unbundle
Upon pull or unbundle, we display a message with the number of
changesets which phase became public. Noticeably, this new message would
appear even if no new changeset were added (below the "no changes found"
message), thus indicating that something actually happened to the local
repository.
--- a/mercurial/scmutil.py Mon May 28 01:36:34 2018 -0400
+++ b/mercurial/scmutil.py Thu May 24 12:19:50 2018 +0200
@@ -1482,6 +1482,24 @@
revrange = '%s:%s' % (minrev, maxrev)
repo.ui.status(_('new changesets %s\n') % revrange)
+ @reportsummary
+ def reportphasechanges(repo, tr):
+ """Report statistics of phase changes for changesets pre-existing
+ pull/unbundle.
+ """
+ newrevs = tr.changes.get('revs', xrange(0, 0))
+ phasetracking = tr.changes.get('phases', {})
+ if not phasetracking:
+ return
+ published = [
+ rev for rev, (old, new) in phasetracking.iteritems()
+ if new == phases.public and rev not in newrevs
+ ]
+ if not published:
+ return
+ repo.ui.status(_('%d changesets became public\n')
+ % len(published))
+
def nodesummaries(repo, nodes, maxnumnodes=4):
if len(nodes) <= maxnumnodes or repo.ui.verbose:
return ' '.join(short(h) for h in nodes)
--- a/tests/test-bundle-r.t Mon May 28 01:36:34 2018 -0400
+++ b/tests/test-bundle-r.t Thu May 24 12:19:50 2018 +0200
@@ -156,6 +156,7 @@
adding file changes
added 4 changesets with 2 changes to 3 files (+1 heads)
new changesets c70afb1ee985:faa2e4234c7a
+ 1 changesets became public
(run 'hg heads' to see heads, 'hg merge' to merge)
$ hg verify
checking changesets
--- a/tests/test-bundle2-exchange.t Mon May 28 01:36:34 2018 -0400
+++ b/tests/test-bundle2-exchange.t Thu May 24 12:19:50 2018 +0200
@@ -150,6 +150,7 @@
pulling from $TESTTMP/main
no changes found
pre-close-tip:24b6387c8c8c public
+ 1 changesets became public
postclose-tip:24b6387c8c8c public
txnclose hook: HG_HOOKNAME=txnclose.env HG_HOOKTYPE=txnclose HG_NEW_OBSMARKERS=0 HG_PHASES_MOVED=1 HG_SOURCE=pull HG_TXNID=TXN:$ID$ HG_TXNNAME=pull
file:/*/$TESTTMP/main HG_URL=file:$TESTTMP/main (glob)
--- a/tests/test-clonebundles.t Mon May 28 01:36:34 2018 -0400
+++ b/tests/test-clonebundles.t Thu May 24 12:19:50 2018 +0200
@@ -129,6 +129,7 @@
adding file changes
added 1 changesets with 1 changes to 1 files
new changesets aaff8d2ffbbf
+ 1 changesets became public
Incremental pull doesn't fetch bundle
@@ -201,6 +202,7 @@
finished applying clone bundle
searching for changes
no changes found
+ 2 changesets became public
Feature works over SSH
@@ -213,6 +215,7 @@
finished applying clone bundle
searching for changes
no changes found
+ 2 changesets became public
Entry with unknown BUNDLESPEC is filtered and not used
@@ -232,6 +235,7 @@
finished applying clone bundle
searching for changes
no changes found
+ 2 changesets became public
Automatic fallback when all entries are filtered
@@ -269,6 +273,7 @@
finished applying clone bundle
searching for changes
no changes found
+ 2 changesets became public
#else
Python <2.7.9 will filter SNI URLs
@@ -373,6 +378,7 @@
finished applying clone bundle
searching for changes
no changes found
+ 2 changesets became public
Preferring bz2 type will download first entry of that type
@@ -385,6 +391,7 @@
finished applying clone bundle
searching for changes
no changes found
+ 2 changesets became public
Preferring multiple values of an option works
@@ -397,6 +404,7 @@
finished applying clone bundle
searching for changes
no changes found
+ 2 changesets became public
Sorting multiple values should get us back to original first entry
@@ -409,6 +417,7 @@
finished applying clone bundle
searching for changes
no changes found
+ 2 changesets became public
Preferring multiple attributes has correct order
@@ -421,6 +430,7 @@
finished applying clone bundle
searching for changes
no changes found
+ 2 changesets became public
Test where attribute is missing from some entries
@@ -440,6 +450,7 @@
finished applying clone bundle
searching for changes
no changes found
+ 2 changesets became public
Test interaction between clone bundles and --stream
@@ -545,3 +556,4 @@
finished applying clone bundle
searching for changes
no changes found
+ 2 changesets became public
--- a/tests/test-convert.t Mon May 28 01:36:34 2018 -0400
+++ b/tests/test-convert.t Thu May 24 12:19:50 2018 +0200
@@ -419,6 +419,7 @@
pulling from ../a
searching for changes
no changes found
+ 5 changesets became public
conversion to existing file should fail
--- a/tests/test-flags.t Mon May 28 01:36:34 2018 -0400
+++ b/tests/test-flags.t Thu May 24 12:19:50 2018 +0200
@@ -46,6 +46,7 @@
adding file changes
added 1 changesets with 0 changes to 0 files (+1 heads)
new changesets 7f4313b42a34
+ 1 changesets became public
(run 'hg heads' to see heads, 'hg merge' to merge)
$ hg heads
changeset: 2:7f4313b42a34
--- a/tests/test-merge6.t Mon May 28 01:36:34 2018 -0400
+++ b/tests/test-merge6.t Thu May 24 12:19:50 2018 +0200
@@ -42,6 +42,7 @@
adding file changes
added 1 changesets with 1 changes to 1 files (+1 heads)
new changesets b90e70beeb58
+ 1 changesets became public
(run 'hg heads' to see heads, 'hg merge' to merge)
$ hg merge
1 files updated, 0 files merged, 0 files removed, 0 files unresolved
--- a/tests/test-obsolete-checkheads.t Mon May 28 01:36:34 2018 -0400
+++ b/tests/test-obsolete-checkheads.t Thu May 24 12:19:50 2018 +0200
@@ -80,6 +80,7 @@
pulling from $TESTTMP/remote
searching for changes
no changes found
+ 1 changesets became public
$ hg log -G --hidden
@ 71e3228bffe1 (draft) add new
|
--- a/tests/test-phases-exchange.t Mon May 28 01:36:34 2018 -0400
+++ b/tests/test-phases-exchange.t Thu May 24 12:19:50 2018 +0200
@@ -167,6 +167,7 @@
pulling from ../alpha
searching for changes
no changes found
+ 1 changesets became public
test-debug-phase: move rev 2: 1 -> 0
$ hgph
o 4 public a-D - b555f63b6063
@@ -283,6 +284,7 @@
adding file changes
added 1 changesets with 1 changes to 1 files
new changesets b555f63b6063
+ 3 changesets became public
test-debug-phase: move rev 0: 1 -> 0
test-debug-phase: move rev 1: 1 -> 0
test-debug-phase: move rev 2: 1 -> 0
@@ -331,6 +333,7 @@
adding file changes
added 2 changesets with 2 changes to 2 files
new changesets d6bcb4f74035:145e75495359
+ 4 changesets became public
test-debug-phase: move rev 0: 1 -> 0
test-debug-phase: move rev 1: 1 -> 0
test-debug-phase: move rev 3: 1 -> 0
@@ -404,6 +407,7 @@
pulling from ../alpha
searching for changes
no changes found
+ 3 changesets became public
test-debug-phase: move rev 3: 1 -> 0
test-debug-phase: move rev 5: 1 -> 0
test-debug-phase: move rev 6: 1 -> 0
--- a/tests/test-pull-branch.t Mon May 28 01:36:34 2018 -0400
+++ b/tests/test-pull-branch.t Thu May 24 12:19:50 2018 +0200
@@ -170,6 +170,7 @@
adding file changes
added 1 changesets with 1 changes to 1 files (+1 heads)
new changesets 7d8ffa4c0b22
+ 13 changesets became public
(run 'hg heads' to see heads)
Make changes on default and branchC on tt
@@ -183,6 +184,7 @@
adding file changes
added 1 changesets with 1 changes to 1 files (+1 heads)
new changesets 2b94b54b6b5f
+ 1 changesets became public
(run 'hg heads' to see heads)
$ hg up -C default
2 files updated, 0 files merged, 0 files removed, 0 files unresolved
@@ -219,6 +221,7 @@
adding file changes
added 2 changesets with 2 changes to 2 files (+2 heads)
new changesets eed40c14b407:e634733b0309
+ 1 changesets became public
(run 'hg heads .' to see heads, 'hg merge' to merge)
$ cd ..
--- a/tests/test-pull-update.t Mon May 28 01:36:34 2018 -0400
+++ b/tests/test-pull-update.t Thu May 24 12:19:50 2018 +0200
@@ -27,6 +27,7 @@
adding file changes
added 1 changesets with 1 changes to 1 files (+1 heads)
new changesets 107cefe13e42
+ 1 changesets became public
abort: uncommitted changes
[255]
$ hg --config extensions.strip= strip --no-backup tip
@@ -58,6 +59,7 @@
adding file changes
added 1 changesets with 1 changes to 1 files (+1 heads)
new changesets 800c91d5bfc1
+ 1 changesets became public
0 files updated, 0 files merged, 0 files removed, 0 files unresolved
updated to "107cefe13e42: m"
1 other heads for branch "default"
@@ -80,6 +82,7 @@
adding file changes
added 1 changesets with 1 changes to 1 files (-1 heads)
new changesets 483b76ad4309
+ 1 changesets became public
1 files updated, 0 files merged, 0 files removed, 0 files unresolved
Similarity between "hg update" and "hg pull -u" in handling bookmark
@@ -108,6 +111,7 @@
added 1 changesets with 1 changes to 1 files
adding remote bookmark active-after-pull
new changesets f815b3da6163
+ 1 changesets became public
1 files updated, 0 files merged, 0 files removed, 0 files unresolved
(activating bookmark active-after-pull)
@@ -137,6 +141,7 @@
added 1 changesets with 1 changes to 1 files
adding remote bookmark active-after-pull
new changesets f815b3da6163
+ 1 changesets became public
1 files updated, 0 files merged, 0 files removed, 0 files unresolved
(activating bookmark active-after-pull)
@@ -175,6 +180,7 @@
adding file changes
added 2 changesets with 1 changes to 1 files
new changesets f815b3da6163:b5e4babfaaa7
+ 1 changesets became public
1 files updated, 0 files merged, 0 files removed, 0 files unresolved
(leaving bookmark active-before-pull)
@@ -202,6 +208,7 @@
adding file changes
added 2 changesets with 1 changes to 1 files
new changesets f815b3da6163:b5e4babfaaa7
+ 1 changesets became public
1 files updated, 0 files merged, 0 files removed, 0 files unresolved
(leaving bookmark active-before-pull)
@@ -229,6 +236,7 @@
adding file changes
added 2 changesets with 1 changes to 1 files
new changesets f815b3da6163:b5e4babfaaa7
+ 1 changesets became public
1 files updated, 0 files merged, 0 files removed, 0 files unresolved
(leaving bookmark active-before-pull)
--- a/tests/test-rename-after-merge.t Mon May 28 01:36:34 2018 -0400
+++ b/tests/test-rename-after-merge.t Thu May 24 12:19:50 2018 +0200
@@ -36,6 +36,7 @@
adding file changes
added 1 changesets with 1 changes to 1 files (+1 heads)
new changesets d2ae7f538514
+ 1 changesets became public
(run 'hg heads' to see heads, 'hg merge' to merge)
$ hg merge
--- a/tests/test-rename-dir-merge.t Mon May 28 01:36:34 2018 -0400
+++ b/tests/test-rename-dir-merge.t Thu May 24 12:19:50 2018 +0200
@@ -219,6 +219,7 @@
adding file changes
added 1 changesets with 1 changes to 1 files (+1 heads)
new changesets 7d51ed18da25
+ 1 changesets became public
(run 'hg heads' to see heads, 'hg merge' to merge)
$ hg merge
--- a/tests/test-share.t Mon May 28 01:36:34 2018 -0400
+++ b/tests/test-share.t Thu May 24 12:19:50 2018 +0200
@@ -360,6 +360,7 @@
searching for changes
no changes found
adding remote bookmark bm3
+ 1 changesets became public
$ hg boo
bm1 3:b87954705719
* bm3 4:62f4ded848e4
--- a/tests/test-simple-update.t Mon May 28 01:36:34 2018 -0400
+++ b/tests/test-simple-update.t Thu May 24 12:19:50 2018 +0200
@@ -31,6 +31,7 @@
adding file changes
added 1 changesets with 1 changes to 1 files
new changesets 30aff43faee1
+ 1 changesets became public
(run 'hg update' to get a working copy)
$ hg verify
--- a/tests/test-treediscovery-legacy.t Mon May 28 01:36:34 2018 -0400
+++ b/tests/test-treediscovery-legacy.t Thu May 24 12:19:50 2018 +0200
@@ -354,6 +354,7 @@
pulling from http://localhost:$HGPORT/
searching for changes
no changes found
+ 1 changesets became public
$ hg push $remote
pushing to http://localhost:$HGPORT/
searching for changes