Mercurial > public > mercurial-scm > hg-stable
diff mercurial/utils/storageutil.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 | a61287a95dc3 |
line wrap: on
line diff
--- a/mercurial/utils/storageutil.py Sun Oct 06 09:45:02 2019 -0400 +++ b/mercurial/utils/storageutil.py Sun Oct 06 09:48:39 2019 -0400 @@ -195,7 +195,7 @@ return store.node(fileid) except IndexError: raise error.LookupError( - '%d' % fileid, identifier, _('no match found') + b'%d' % fileid, identifier, _(b'no match found') ) if len(fileid) == 20: @@ -226,7 +226,7 @@ except (ValueError, OverflowError): pass - raise error.LookupError(fileid, identifier, _('no match found')) + raise error.LookupError(fileid, identifier, _(b'no match found')) def resolvestripinfo(minlinkrev, tiprev, headrevs, linkrevfn, parentrevsfn): @@ -361,9 +361,9 @@ fnode = store.node frev = store.rev - if nodesorder == 'nodes': + if nodesorder == b'nodes': revs = [frev(n) for n in nodes] - elif nodesorder == 'linear': + elif nodesorder == b'linear': revs = set(frev(n) for n in nodes) revs = dagop.linearize(revs, store.parentrevs) else: # storage and default @@ -498,7 +498,7 @@ # "\1\ncensored:". A delta producing such a censored revision must be a # full-replacement delta, so we inspect the first and only patch in the # delta for this prefix. - hlen = struct.calcsize(">lll") + hlen = struct.calcsize(b">lll") if len(delta) <= hlen: return False @@ -507,6 +507,6 @@ if delta[:hlen] != mdiff.replacediffheader(oldlen, newlen): return False - add = "\1\ncensored:" + add = b"\1\ncensored:" addlen = len(add) return newlen >= addlen and delta[hlen : hlen + addlen] == add