Mercurial > public > mercurial-scm > hg-stable
diff mercurial/localrepo.py @ 46902:631001150e13
narrow: add capabilities for local repos, not just remote peers
This fixes the bug where running `hg clone --narrow ./local-repo`
fails with
abort: server does not support narrow clones
even when the server has narrow enabled.
Differential Revision: https://phab.mercurial-scm.org/D10357
author | Charles Chamberlain <cchamberlain@janestreet.com> |
---|---|
date | Fri, 09 Apr 2021 17:41:48 -0400 |
parents | 218a26df7813 |
children | ffd3e823a7e5 |
line wrap: on
line diff
--- a/mercurial/localrepo.py Thu Mar 25 22:29:41 2021 -0400 +++ b/mercurial/localrepo.py Fri Apr 09 17:41:48 2021 -0400 @@ -73,6 +73,7 @@ txnutil, util, vfs as vfsmod, + wireprototypes, ) from .interfaces import ( @@ -1495,6 +1496,8 @@ bundle2.getrepocaps(self, role=b'client') ) caps.add(b'bundle2=' + urlreq.quote(capsblob)) + if self.ui.configbool(b'experimental', b'narrow'): + caps.add(wireprototypes.NARROWCAP) return caps # Don't cache auditor/nofsauditor, or you'll end up with reference cycle: