Mercurial > hg-stable
diff mercurial/bundlerepo.py @ 17191:5884812686f7
peer: introduce peer methods to prepare for peer classes
This introduces a peer method into all repository classes, which currently
simply returns self. It also changes hg.repository so it now raises an
exception if the supplied paths does not resolve to a localrepo or descendant.
Finally, all call sites are changed to use the peer and local methods as
appropriate, where peer is used whenever the code is dealing with a remote
repository (even if it's on local disk).
author | Sune Foldager <cryo@cyanite.org> |
---|---|
date | Fri, 13 Jul 2012 21:46:53 +0200 |
parents | 67964cda8701 |
children | 1d710fe5ee0e |
line wrap: on
line diff
--- a/mercurial/bundlerepo.py Fri Jul 06 14:12:42 2012 -0500 +++ b/mercurial/bundlerepo.py Fri Jul 13 21:46:53 2012 +0200 @@ -344,8 +344,8 @@ bundle = None bundlerepo = None - localrepo = other - if bundlename or not other.local(): + localrepo = other.local() + if bundlename or not localrepo: # create a bundle (uncompressed if other repo is not local) if other.capable('getbundle'): @@ -356,12 +356,12 @@ rheads = None else: cg = other.changegroupsubset(incoming, rheads, 'incoming') - bundletype = other.local() and "HG10BZ" or "HG10UN" + bundletype = localrepo and "HG10BZ" or "HG10UN" fname = bundle = changegroup.writebundle(cg, bundlename, bundletype) # keep written bundle? if bundlename: bundle = None - if not other.local(): + if not localrepo: # use the created uncompressed bundlerepo localrepo = bundlerepo = bundlerepository(ui, repo.root, fname) # this repo contains local and other now, so filter out local again