comparison hgext/lfs/wrapper.py @ 37084:f0b6fbea00cf

stringutil: bulk-replace call sites to point to new module This might conflict with other patches floating around, sorry.
author Yuya Nishihara <yuya@tcha.org>
date Thu, 22 Mar 2018 21:56:20 +0900
parents f6b9f9ddd0de
children a54113fcc8c9
comparison
equal deleted inserted replaced
37083:f99d64e8a4e4 37084:f0b6fbea00cf
15 from mercurial import ( 15 from mercurial import (
16 error, 16 error,
17 filelog, 17 filelog,
18 revlog, 18 revlog,
19 util, 19 util,
20 )
21
22 from mercurial.utils import (
23 stringutil,
20 ) 24 )
21 25
22 from ..largefiles import lfutil 26 from ..largefiles import lfutil
23 27
24 from . import ( 28 from . import (
93 metadata = pointer.gitlfspointer(oid=longoid, size='%d' % len(text)) 97 metadata = pointer.gitlfspointer(oid=longoid, size='%d' % len(text))
94 98
95 # by default, we expect the content to be binary. however, LFS could also 99 # by default, we expect the content to be binary. however, LFS could also
96 # be used for non-binary content. add a special entry for non-binary data. 100 # be used for non-binary content. add a special entry for non-binary data.
97 # this will be used by filectx.isbinary(). 101 # this will be used by filectx.isbinary().
98 if not util.binary(text): 102 if not stringutil.binary(text):
99 # not hg filelog metadata (affecting commit hash), no "x-hg-" prefix 103 # not hg filelog metadata (affecting commit hash), no "x-hg-" prefix
100 metadata['x-is-binary'] = '0' 104 metadata['x-is-binary'] = '0'
101 105
102 # translate hg filelog metadata to lfs metadata with "x-hg-" prefix 106 # translate hg filelog metadata to lfs metadata with "x-hg-" prefix
103 if hgmeta is not None: 107 if hgmeta is not None: