Mercurial > public > mercurial-scm > hg
comparison hgext/lfs/blobstore.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 | c59eb1560c44 |
comparison
equal
deleted
inserted
replaced
43076:2372284d9457 | 43077:687b865b95ad |
---|---|
64 if len(dirpath) == 2: | 64 if len(dirpath) == 2: |
65 oids.extend( | 65 oids.extend( |
66 [dirpath + f for f in files if _lfsre.match(dirpath + f)] | 66 [dirpath + f for f in files if _lfsre.match(dirpath + f)] |
67 ) | 67 ) |
68 | 68 |
69 yield ('', [], oids) | 69 yield (b'', [], oids) |
70 | 70 |
71 | 71 |
72 class nullvfs(lfsvfs): | 72 class nullvfs(lfsvfs): |
73 def __init__(self): | 73 def __init__(self): |
74 pass | 74 pass |
254 inst = urlerror | 254 inst = urlerror |
255 | 255 |
256 if isinstance(urlerror.reason, Exception): | 256 if isinstance(urlerror.reason, Exception): |
257 inst = urlerror.reason | 257 inst = urlerror.reason |
258 | 258 |
259 if util.safehasattr(inst, 'reason'): | 259 if util.safehasattr(inst, b'reason'): |
260 try: # usually it is in the form (errno, strerror) | 260 try: # usually it is in the form (errno, strerror) |
261 reason = inst.reason.args[1] | 261 reason = inst.reason.args[1] |
262 except (AttributeError, IndexError): | 262 except (AttributeError, IndexError): |
263 # it might be anything, for example a string | 263 # it might be anything, for example a string |
264 reason = inst.reason | 264 reason = inst.reason |
701 ``hg serve`` works out of the box. | 701 ``hg serve`` works out of the box. |
702 | 702 |
703 https://github.com/git-lfs/git-lfs/blob/master/docs/api/server-discovery.md | 703 https://github.com/git-lfs/git-lfs/blob/master/docs/api/server-discovery.md |
704 """ | 704 """ |
705 lfsurl = repo.ui.config(b'lfs', b'url') | 705 lfsurl = repo.ui.config(b'lfs', b'url') |
706 url = util.url(lfsurl or '') | 706 url = util.url(lfsurl or b'') |
707 if lfsurl is None: | 707 if lfsurl is None: |
708 if remote: | 708 if remote: |
709 path = remote | 709 path = remote |
710 elif util.safehasattr(repo, '_subtoppath'): | 710 elif util.safehasattr(repo, b'_subtoppath'): |
711 # The pull command sets this during the optional update phase, which | 711 # The pull command sets this during the optional update phase, which |
712 # tells exactly where the pull originated, whether 'paths.default' | 712 # tells exactly where the pull originated, whether 'paths.default' |
713 # or explicit. | 713 # or explicit. |
714 path = repo._subtoppath | 714 path = repo._subtoppath |
715 else: | 715 else: |