diff mercurial/changegroup.py @ 20966:63659b809021

phase: apply publishing enforcement for "serve" source When a changegroup is added by a push on a publishing server, we ensure they are added as public. This is used to enforce publishing on server when the client is not aware of phases. It also prevents race conditions where a reader could see the changesets as draft before they get turned public by the client. Finally, this save rounds trip as the client does not need additional request to turn them public. However, this logic was only enforced when the changegroup was from a "push" source. And "push" is used for local pushes only. Wireprotocol push uses "serve" as source since Mercurial 1.9. We now enforce this logic for both "push" and "serve" sources. One could note that this logic was mainly useful during wireprotocol exchanges. So this code is finally put into good use, 9 versions after its introduction.
author Pierre-Yves David <pierre-yves.david@fb.com>
date Mon, 07 Apr 2014 18:10:50 -0700
parents 3737e653dcbe
children c20f4898631e
line wrap: on
line diff
--- a/mercurial/changegroup.py	Thu Apr 10 12:41:39 2014 -0400
+++ b/mercurial/changegroup.py	Mon Apr 07 18:10:50 2014 -0700
@@ -677,7 +677,7 @@
 
         added = [cl.node(r) for r in xrange(clstart, clend)]
         publishing = repo.ui.configbool('phases', 'publish', True)
-        if srctype == 'push':
+        if srctype in ('push', 'serve'):
             # Old servers can not push the boundary themselves.
             # New servers won't push the boundary if changeset already
             # exists locally as secret