diff --git a/hgext/narrow/narrowbundle2.py b/hgext/narrow/narrowbundle2.py --- a/hgext/narrow/narrowbundle2.py +++ b/hgext/narrow/narrowbundle2.py @@ -21,6 +21,7 @@ error, exchange, extensions, + match as matchmod, narrowspec, repair, repository, @@ -72,6 +73,9 @@ newmatch = narrowspec.match(repo.root, include=include, exclude=exclude) oldinclude = sorted(filter(bool, kwargs.get(r'oldincludepats', []))) oldexclude = sorted(filter(bool, kwargs.get(r'oldexcludepats', []))) + oldmatch = narrowspec.match(repo.root, include=oldinclude, + exclude=oldexclude) + diffmatch = matchmod.differencematcher(newmatch, oldmatch) common = set(common or [nullid]) if (oldinclude != include or oldexclude != exclude): @@ -84,7 +88,7 @@ # XXX: we should only send the filelogs (and treemanifest). user # already has the changelog and manifest packer = changegroup.getbundler(version, repo, - filematcher=newmatch, + filematcher=diffmatch, fullnodes=commonnodes) cgdata = packer.generate(set([nullid]), list(commonnodes), False, source) diff --git a/tests/test-narrow-widen-no-ellipsis.t b/tests/test-narrow-widen-no-ellipsis.t --- a/tests/test-narrow-widen-no-ellipsis.t +++ b/tests/test-narrow-widen-no-ellipsis.t @@ -95,7 +95,7 @@ adding changesets adding manifests adding file changes - added 0 changesets with 1 changes to 2 files + added 0 changesets with 1 changes to 1 files 3 local changesets published $ hg tracked I path:inside @@ -154,7 +154,7 @@ adding changesets adding manifests adding file changes - added 0 changesets with 1 changes to 3 files + added 0 changesets with 1 changes to 1 files 5 local changesets published $ hg tracked I path:inside @@ -259,7 +259,7 @@ adding changesets adding manifests adding file changes - added 0 changesets with 1 changes to 5 files + added 0 changesets with 1 changes to 1 files 11 local changesets published $ hg tracked I path:d0 @@ -351,7 +351,7 @@ adding changesets adding manifests adding file changes - added 0 changesets with 1 changes to 2 files + added 0 changesets with 1 changes to 1 files 11 local changesets published $ hg log -T "{if(ellipsis, '...')}{rev}: {desc}\n" 11: local