[PATCH 4 of 6 V2] peer: remove cancopy from peer api; use directly on repo instead

Sune Foldager cryo at cyanite.org
Fri Jul 13 15:12:46 CDT 2012


# HG changeset patch
# User Sune Foldager <cryo at cyanite.org>
# Date 1342209157 -7200
# Node ID a5e5cf65a270907eca0e1249a2699b64b7a05d0d
# Parent  7a27d84d6ede52603e7a3bd73bbd1a1253882a56
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
@@ -300,7 +300,7 @@
             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 @@
     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 @@
     def peer(self):
         return self
 
-    def cancopy(self):
-        return False
-
     def canpush(self):
         return True
 


More information about the Mercurial-devel mailing list