From patchwork Tue May 28 15:02:52 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Subject: [1, of, 3, STABLE] bundlerepo: add "unfiltered()" to bundlepeer to get peer using unfiltered repo From: Katsunori FUJIWARA X-Patchwork-Id: 1667 Message-Id: <32537a1588d2b80e9d40.1369753372@feefifofum> To: mercurial-devel@selenic.com Date: Wed, 29 May 2013 00:02:52 +0900 # HG changeset patch # User FUJIWARA Katsunori # Date 1369751660 -32400 # Tue May 28 23:34:20 2013 +0900 # Branch stable # Node ID 32537a1588d2b80e9d40d8c61327391162f2b929 # Parent 39ea540dc1543b5ed31251ef9f394c7902c65f19 bundlerepo: add "unfiltered()" to bundlepeer to get peer using unfiltered repo This is required to fix "hg incoming" problem in succeeding patch. diff --git a/mercurial/bundlerepo.py b/mercurial/bundlerepo.py --- a/mercurial/bundlerepo.py +++ b/mercurial/bundlerepo.py @@ -166,6 +166,12 @@ def canpush(self): return False + def unfiltered(self): + if not self._filtered: + return self + return bundlepeer(self._repo.unfiltered(), + caps=self._caps, filtered=False) + class bundlerepository(localrepo.localrepository): def __init__(self, ui, path, bundlename): self._tempparent = None diff --git a/mercurial/localrepo.py b/mercurial/localrepo.py --- a/mercurial/localrepo.py +++ b/mercurial/localrepo.py @@ -64,9 +64,13 @@ class localpeer(peer.peerrepository): '''peer for a local repo; reflects only the most recent API''' - def __init__(self, repo, caps=MODERNCAPS): + def __init__(self, repo, caps=MODERNCAPS, filtered=True): peer.peerrepository.__init__(self) - self._repo = repo.filtered('served') + if filtered: + self._repo = repo.filtered('served') + else: + self._repo = repo + self._filtered = filtered self.ui = repo.ui self._caps = repo._restrictcapabilities(caps) self.requirements = repo.requirements