[Pkg-bazaar-commits] ./bzr/unstable r417: - trace when we fetch a URL

Martin Pool mbp at sourcefrog.net
Fri Apr 10 07:43:38 UTC 2009


------------------------------------------------------------
revno: 417
committer: Martin Pool <mbp at sourcefrog.net>
timestamp: Mon 2005-05-09 18:30:42 +1000
message:
  - trace when we fetch a URL
modified:
  bzrlib/remotebranch.py
-------------- next part --------------
=== modified file 'bzrlib/remotebranch.py'
--- a/bzrlib/remotebranch.py	2005-05-09 08:27:49 +0000
+++ b/bzrlib/remotebranch.py	2005-05-09 08:30:42 +0000
@@ -31,6 +31,7 @@
 
 from errors import BzrError, BzrCheckError
 from branch import Branch
+from trace import mutter
 
 # velocitynet.com.au transparently proxies connections and thereby
 # breaks keep-alive -- sucks!
@@ -43,12 +44,14 @@
     import urllib2
     if compressed:
         url += '.gz'
+    mutter("get_url %s" % url)
     url_f = urllib2.urlopen(url)
     if compressed:
         return gzip.GzipFile(fileobj=StringIO(url_f.read()))
     else:
         return url_f
 
+
 if ENABLE_URLGRABBER:
     import urlgrabber
     import urlgrabber.keepalive
@@ -98,6 +101,11 @@
         self.baseurl = baseurl
         self._check_format()
 
+    def __str__(self):
+        return '%s(%r)' % (self.__class__.__name__, self.baseurl)
+
+    __repr__ = __str__
+
     def controlfile(self, filename, mode):
         if mode not in ('rb', 'rt', 'r'):
             raise BzrError("file mode %r not supported for remote branches" % mode)



More information about the Pkg-bazaar-commits mailing list