[PATCH 3 of 7] push: more robust check for bundle fast path

pierre-yves.david at ens-lyon.org pierre-yves.david at ens-lyon.org
Sun Nov 17 14:31:42 CST 2013


# HG changeset patch
# User Pierre-Yves David <pierre-yves.david at ens-lyon.org>
# Date 1383673064 -3600
#      Tue Nov 05 18:37:44 2013 +0100
# Node ID f4ba2c3b6d5d25ac6af8e2e226b38b43596950ca
# Parent  51cf4e4a5eb7a5609a50378a98ce6f7fa0fa721c
push: more robust check for bundle fast path

When all changesets in the local repo are either being pushed or remotly known,
we can take a fast path when bundling changeset because we are certain all local
deltas are computed againts base known remotely.

So we have a check to detect this situation, when we did a bare push and nothing
was excluded.

In a coming refactoring, the discovery will run on filtered view and the content
of `outgoing.excluded` will just include unserved (secret) changeset not filtered by the
repoview used to call push (usually "visible"). So we need to check if there is
both no excluded changeset and nothing filtered by the current repoview.

diff --git a/mercurial/localrepo.py b/mercurial/localrepo.py
--- a/mercurial/localrepo.py
+++ b/mercurial/localrepo.py
@@ -1862,11 +1862,12 @@ class localrepository(object):
                                              bool(inc))
 
                     # TODO: get bundlecaps from remote
                     bundlecaps = None
                     # create a changegroup from local
-                    if revs is None and not outgoing.excluded:
+                    if revs is None and not (outgoing.excluded
+                                             or self.changelog.filteredrevs):
                         # push everything,
                         # use the fast path, no race possible on push
                         bundler = changegroup.bundle10(self, bundlecaps)
                         cg = self._changegroupsubset(outgoing,
                                                      bundler,


More information about the Mercurial-devel mailing list