[PATCH] push: add a message when pushing phases but not changes

Jeremy Wall (zaphar) jeremy at marzhillstudios.com
Fri Dec 2 14:12:20 EST 2016


# HG changeset patch
# User Jeremy Wall (zaphar) <jeremy at marzhillstudios.com>
# Date 1480542942 21600
#      Wed Nov 30 15:55:42 2016 -0600
# Node ID 9cb1540e417dc79a55944adffb691a3ada01571c
# Parent  9e29d4e4e08b5996adda49cdd0b497d89e2b16ee
push: add a message when pushing phases but not changes

This is an attempt to fix
https://bz.mercurial-scm.org/show_bug.cgi?id=4232

diff -r 9e29d4e4e08b -r 9cb1540e417d mercurial/exchange.py
--- a/mercurial/exchange.py	Tue Nov 29 04:11:05 2016 -0800
+++ b/mercurial/exchange.py	Wed Nov 30 15:55:42 2016 -0600
@@ -14,6 +14,7 @@
 from .node import (
     hex,
     nullid,
+    short,
 )
 from . import (
     base85,
@@ -643,9 +644,20 @@
 def _pushcheckoutgoing(pushop):
     outgoing = pushop.outgoing
     unfi = pushop.repo.unfiltered()
+    ui = unfi.ui
     if not outgoing.missing:
-        # nothing to push
-        scmutil.nochangesfound(unfi.ui, unfi, outgoing.excluded)
+        # TODO(jeremy): Question? Should I be worrying about
+        # fallbackoutdatedphases here too?
+        # phases to push
+        if pushop.outdatedphases:
+            for outphase in pushop.outdatedphases:
+                # TODO(jeremy): Is this the right way to report this?
+                ui.status(_("sending phase %s for %s\n") %
+                          (outphase.phasestr(), short(outphase.node())))
+                # TODO(jeremy): Do I still return false?
+        else:
+            # nothing to push
+            scmutil.nochangesfound(ui, unfi, outgoing.excluded)
         return False
     # something to push
     if not pushop.force:
diff -r 9e29d4e4e08b -r 9cb1540e417d tests/test-phases-exchange.t
--- a/tests/test-phases-exchange.t	Tue Nov 29 04:11:05 2016 -0800
+++ b/tests/test-phases-exchange.t	Wed Nov 30 15:55:42 2016 -0600
@@ -384,7 +384,7 @@
   $ hg push ../alpha # from nu
   pushing to ../alpha
   searching for changes
-  no changes found
+  sending phase public for 145e75495359
   [1]
   $ cd ..
   $ cd alpha
@@ -600,7 +600,7 @@
   $ hg push ../alpha
   pushing to ../alpha
   searching for changes
-  no changes found
+  sending phase public for b740e3e5c05d
   [1]
   $ hgph
   o  6 public a-F - b740e3e5c05d
@@ -705,7 +705,7 @@
   $ hg push ../alpha
   pushing to ../alpha
   searching for changes
-  no changes found
+  sending phase draft for 967b449fbc94
   [1]
   $ hgph
   o  9 public a-H - 967b449fbc94
diff -r 9e29d4e4e08b -r 9cb1540e417d tests/test-push-warn.t
--- a/tests/test-push-warn.t	Tue Nov 29 04:11:05 2016 -0800
+++ b/tests/test-push-warn.t	Wed Nov 30 15:55:42 2016 -0600
@@ -125,7 +125,7 @@
   $ hg push -r 2 ../c
   pushing to ../c
   searching for changes
-  no changes found
+  sending phase public for d9f42cd1a1ec
   [1]
 
   $ hg push -r 3 ../c
diff -r 9e29d4e4e08b -r 9cb1540e417d tests/test-subrepo.t
--- a/tests/test-subrepo.t	Tue Nov 29 04:11:05 2016 -0800
+++ b/tests/test-subrepo.t	Wed Nov 30 15:55:42 2016 -0600
@@ -1519,7 +1519,13 @@
 (issue3781)
 
   $ cp -r main issue3781
+  cp: main/.hg/cache/checklink: No such file or directory
+  cp: main/s/.hg/cache/checklink: No such file or directory
+  [1]
   $ cp -r main issue3781-dest
+  cp: main/.hg/cache/checklink: No such file or directory
+  cp: main/s/.hg/cache/checklink: No such file or directory
+  [1]
   $ cd issue3781-dest/s
   $ hg phase tip # show we have draft changeset
   5: draft
@@ -1535,7 +1541,8 @@
   searching for changes
   no changes found
   searching for changes
-  no changes found
+  sending phase draft for d6125d9cc876
+  sending phase draft for 8bd5629adcbe
   [1]
 # clean the push cache
   $ rm s/.hg/cache/storehash/*
diff -r 9e29d4e4e08b -r 9cb1540e417d tests/test-treediscovery-legacy.t
--- a/tests/test-treediscovery-legacy.t	Tue Nov 29 04:11:05 2016 -0800
+++ b/tests/test-treediscovery-legacy.t	Wed Nov 30 15:55:42 2016 -0600
@@ -115,7 +115,7 @@
   $ hg push $remote
   pushing to http://localhost:$HGPORT/
   searching for changes
-  no changes found
+  sending phase public for a19bfa7e7328
   [1]
   $ cd ..
 
diff -r 9e29d4e4e08b -r 9cb1540e417d tests/test-treediscovery.t
--- a/tests/test-treediscovery.t	Tue Nov 29 04:11:05 2016 -0800
+++ b/tests/test-treediscovery.t	Wed Nov 30 15:55:42 2016 -0600
@@ -104,7 +104,7 @@
   $ hg push $remote
   pushing to http://localhost:$HGPORT/
   searching for changes
-  no changes found
+  sending phase public for a19bfa7e7328
   [1]
   $ cd ..
 


More information about the Mercurial-devel mailing list