equal
deleted
inserted
replaced
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: |