hgext/lfs/pointer.py
changeset 43076 2372284d9457
parent 39777 b63dee7bd0d9
child 43077 687b865b95ad
--- a/hgext/lfs/pointer.py	Sat Oct 05 10:29:34 2019 -0400
+++ b/hgext/lfs/pointer.py	Sun Oct 06 09:45:02 2019 -0400
@@ -15,13 +15,13 @@
     error,
     pycompat,
 )
-from mercurial.utils import (
-    stringutil,
-)
+from mercurial.utils import stringutil
+
 
 class InvalidPointer(error.StorageError):
     pass
 
+
 class gitlfspointer(dict):
     VERSION = 'https://git-lfs.github.com/spec/v1'
 
@@ -34,9 +34,10 @@
     def deserialize(cls, text):
         try:
             return cls(l.split(' ', 1) for l in text.splitlines()).validate()
-        except ValueError: # l.split returns 1 item instead of 2
-            raise InvalidPointer(_('cannot parse git-lfs text: %s')
-                                 % stringutil.pprint(text))
+        except ValueError:  # l.split returns 1 item instead of 2
+            raise InvalidPointer(
+                _('cannot parse git-lfs text: %s') % stringutil.pprint(text)
+            )
 
     def serialize(self):
         sortkeyfunc = lambda x: (x[0] != 'version', x)
@@ -67,17 +68,22 @@
                 if not self._requiredre[k].match(v):
                     raise InvalidPointer(
                         _('unexpected lfs pointer value: %s=%s')
-                        % (k, stringutil.pprint(v)))
+                        % (k, stringutil.pprint(v))
+                    )
                 requiredcount += 1
             elif not self._keyre.match(k):
                 raise InvalidPointer(_('unexpected lfs pointer key: %s') % k)
             if not self._valuere.match(v):
-                raise InvalidPointer(_('unexpected lfs pointer value: %s=%s')
-                                     % (k, stringutil.pprint(v)))
+                raise InvalidPointer(
+                    _('unexpected lfs pointer value: %s=%s')
+                    % (k, stringutil.pprint(v))
+                )
         if len(self._requiredre) != requiredcount:
             miss = sorted(set(self._requiredre.keys()).difference(self.keys()))
-            raise InvalidPointer(_('missing lfs pointer keys: %s')
-                                 % ', '.join(miss))
+            raise InvalidPointer(
+                _('missing lfs pointer keys: %s') % ', '.join(miss)
+            )
         return self
 
+
 deserialize = gitlfspointer.deserialize