diff hgext/largefiles/remotestore.py @ 43077:687b865b95ad

formatting: byteify all mercurial/ and hgext/ string literals Done with python3.7 contrib/byteify-strings.py -i $(hg files 'set:mercurial/**.py - mercurial/thirdparty/** + hgext/**.py - hgext/fsmonitor/pywatchman/** - mercurial/__init__.py') black -l 80 -t py33 -S $(hg files 'set:**.py - mercurial/thirdparty/** - "contrib/python-zstandard/**" - hgext/fsmonitor/pywatchman/**') # skip-blame mass-reformatting only Differential Revision: https://phab.mercurial-scm.org/D6972
author Augie Fackler <augie@google.com>
date Sun, 06 Oct 2019 09:48:39 -0400
parents 2372284d9457
children 649d3ac37a12
line wrap: on
line diff
--- a/hgext/largefiles/remotestore.py	Sun Oct 06 09:45:02 2019 -0400
+++ b/hgext/largefiles/remotestore.py	Sun Oct 06 09:48:39 2019 -0400
@@ -38,11 +38,11 @@
     def put(self, source, hash):
         if self.sendfile(source, hash):
             raise error.Abort(
-                _('remotestore: could not put %s to remote store %s')
+                _(b'remotestore: could not put %s to remote store %s')
                 % (source, util.hidepassword(self.url))
             )
         self.ui.debug(
-            _('remotestore: put %s to remote store %s\n')
+            _(b'remotestore: put %s to remote store %s\n')
             % (source, util.hidepassword(self.url))
         )
 
@@ -53,13 +53,13 @@
         )
 
     def sendfile(self, filename, hash):
-        self.ui.debug('remotestore: sendfile(%s, %s)\n' % (filename, hash))
+        self.ui.debug(b'remotestore: sendfile(%s, %s)\n' % (filename, hash))
         try:
             with lfutil.httpsendfile(self.ui, filename) as fd:
                 return self._put(hash, fd)
         except IOError as e:
             raise error.Abort(
-                _('remotestore: could not open file %s: %s')
+                _(b'remotestore: could not open file %s: %s')
                 % (filename, stringutil.forcebytestr(e))
             )
 
@@ -77,7 +77,7 @@
             # keep trying with the other files... they will probably
             # all fail too.
             raise error.Abort(
-                '%s: %s' % (util.hidepassword(self.url), e.reason)
+                b'%s: %s' % (util.hidepassword(self.url), e.reason)
             )
         except IOError as e:
             raise basestore.StoreError(
@@ -118,33 +118,33 @@
                 if stat:
                     if stat == 1:
                         self.ui.warn(
-                            _('changeset %s: %s: contents differ\n')
+                            _(b'changeset %s: %s: contents differ\n')
                             % (cset, filename)
                         )
                         failed = True
                     elif stat == 2:
                         self.ui.warn(
-                            _('changeset %s: %s missing\n') % (cset, filename)
+                            _(b'changeset %s: %s missing\n') % (cset, filename)
                         )
                         failed = True
                     else:
                         raise RuntimeError(
-                            'verify failed: unexpected response '
-                            'from statlfile (%r)' % stat
+                            b'verify failed: unexpected response '
+                            b'from statlfile (%r)' % stat
                         )
         return failed
 
     def _put(self, hash, fd):
         '''Put file with the given hash in the remote store.'''
-        raise NotImplementedError('abstract method')
+        raise NotImplementedError(b'abstract method')
 
     def _get(self, hash):
         '''Get a iterator for content with the given hash.'''
-        raise NotImplementedError('abstract method')
+        raise NotImplementedError(b'abstract method')
 
     def _stat(self, hashes):
         '''Get information about availability of files specified by
         hashes in the remote store. Return dictionary mapping hashes
         to return code where 0 means that file is available, other
         values if not.'''
-        raise NotImplementedError('abstract method')
+        raise NotImplementedError(b'abstract method')