# HG changeset patch # User Sune Foldager # Date 2012-07-13 19:52:37 # Node ID 32a6a33b9a355ceafb2c6cdeed88ebb63a6cbfc9 # Parent 1d710fe5ee0e99a724311724dda32289b0733c61 peer: remove cancopy from peer api; use directly on repo instead diff --git a/mercurial/hg.py b/mercurial/hg.py --- a/mercurial/hg.py +++ b/mercurial/hg.py @@ -302,7 +302,8 @@ def clone(ui, peeropts, source, dest=Non dircleanup = DirCleanup(dest) copy = False - if srcpeer.cancopy() and islocal(dest) and not srcrepo.revs("secret()"): + if (srcrepo and srcrepo.cancopy() and islocal(dest) + and not srcrepo.revs("secret()")): copy = not pull and not rev if copy: diff --git a/mercurial/localrepo.py b/mercurial/localrepo.py --- a/mercurial/localrepo.py +++ b/mercurial/localrepo.py @@ -46,9 +46,6 @@ class localpeer(peer.peerrepository): def local(self): return self._repo - def cancopy(self): - return self._repo.cancopy() # so bundlerepo can override - def canpush(self): return True diff --git a/mercurial/peer.py b/mercurial/peer.py --- a/mercurial/peer.py +++ b/mercurial/peer.py @@ -42,9 +42,6 @@ class peerrepository(object): def peer(self): return self - def cancopy(self): - return False - def canpush(self): return True