httprepo: suppress the `real URL is...' message in safe, common cases.
authorDan Villiom Podlaski Christiansen <danchr@gmail.com>
Wed, 18 Nov 2009 12:47:58 +0100
changeset 9881 54b518fc6671
parent 9880 a1886801d466
child 9882 b3b57ecbda50
httprepo: suppress the `real URL is...' message in safe, common cases. When the actual and requested URL only differ by trailing slashes, there is no need to warn. As an example, this easily happens when accessing repositories on Bitbucket over HTTP(S). As far as I could tell, there were no existing tests for this behaviour.
mercurial/httprepo.py
--- a/mercurial/httprepo.py	Wed Nov 18 17:09:00 2009 +0100
+++ b/mercurial/httprepo.py	Wed Nov 18 12:47:58 2009 +0100
@@ -93,7 +93,7 @@
         resp_url = resp.geturl()
         if resp_url.endswith(qs):
             resp_url = resp_url[:-len(qs)]
-        if self._url != resp_url:
+        if self._url.rstrip('/') != resp_url.rstrip('/'):
             self.ui.status(_('real URL is %s\n') % resp_url)
             self._url = resp_url
         try: