diff hgext/largefiles/remotestore.py @ 19950:cce7ab960312 stable

largefiles: hide passwords in URLs in ui messages
author Mads Kiilerich <madski@unity3d.com>
date Thu, 17 Oct 2013 16:13:15 +0800
parents 72214af683a2
children a61ed1c2d7a7
line wrap: on
line diff
--- a/hgext/largefiles/remotestore.py	Thu Oct 24 01:49:56 2013 +0800
+++ b/hgext/largefiles/remotestore.py	Thu Oct 17 16:13:15 2013 +0800
@@ -24,9 +24,10 @@
         if self.sendfile(source, hash):
             raise util.Abort(
                 _('remotestore: could not put %s to remote store %s')
-                % (source, self.url))
+                % (source, util.hidepassword(self.url)))
         self.ui.debug(
-            _('remotestore: put %s to remote store %s\n') % (source, self.url))
+            _('remotestore: put %s to remote store %s\n')
+            % (source, util.hidepassword(self.url)))
 
     def exists(self, hashes):
         return dict((h, s == 0) for (h, s) in self._stat(hashes).iteritems())
@@ -57,7 +58,8 @@
             # This usually indicates a connection problem, so don't
             # keep trying with the other files... they will probably
             # all fail too.
-            raise util.Abort('%s: %s' % (self.url, e.reason))
+            raise util.Abort('%s: %s' %
+                             (util.hidepassword(self.url), e.reason))
         except IOError, e:
             raise basestore.StoreError(filename, hash, self.url, str(e))