Show More
@@ -15,6 +15,7 b' from mercurial.i18n import _' | |||||
15 |
|
15 | |||
16 | from mercurial import ( |
|
16 | from mercurial import ( | |
17 | error, |
|
17 | error, | |
|
18 | extensions, | |||
18 | localrepo, |
|
19 | localrepo, | |
19 | match as matchmod, |
|
20 | match as matchmod, | |
20 | scmutil, |
|
21 | scmutil, | |
@@ -47,13 +48,14 b' def reposetup(ui, repo):' | |||||
47 | ctx = super(lfilesrepo, self).__getitem__(changeid) |
|
48 | ctx = super(lfilesrepo, self).__getitem__(changeid) | |
48 | if self.lfstatus: |
|
49 | if self.lfstatus: | |
49 |
|
50 | |||
50 |
|
|
51 | def files(orig): | |
51 |
|
|
52 | filenames = orig() | |
52 | filenames = super(lfilesctx, self).files() |
|
|||
53 |
|
|
53 | return [lfutil.splitstandin(f) or f for f in filenames] | |
54 |
|
54 | |||
55 | def manifest(self): |
|
55 | extensions.wrapfunction(ctx, 'files', files) | |
56 | man1 = super(lfilesctx, self).manifest() |
|
56 | ||
|
57 | def manifest(orig): | |||
|
58 | man1 = orig() | |||
57 |
|
59 | |||
58 |
|
|
60 | class lfilesmanifest(man1.__class__): | |
59 |
|
|
61 | def __contains__(self, filename): | |
@@ -65,8 +67,9 b' def reposetup(ui, repo):' | |||||
65 |
|
|
67 | man1.__class__ = lfilesmanifest | |
66 |
|
|
68 | return man1 | |
67 |
|
69 | |||
68 | def filectx(self, path, fileid=None, filelog=None): |
|
70 | extensions.wrapfunction(ctx, 'manifest', manifest) | |
69 | orig = super(lfilesctx, self).filectx |
|
71 | ||
|
72 | def filectx(orig, path, fileid=None, filelog=None): | |||
70 |
|
|
73 | try: | |
71 |
|
|
74 | if filelog is not None: | |
72 |
|
|
75 | result = orig(path, fileid, filelog) | |
@@ -76,16 +79,15 b' def reposetup(ui, repo):' | |||||
76 |
|
|
79 | # Adding a null character will cause Mercurial to | |
77 |
|
|
80 | # identify this as a binary file. | |
78 |
|
|
81 | if filelog is not None: | |
79 |
|
|
82 | result = orig(lfutil.standin(path), fileid, filelog) | |
80 | lfutil.standin(path), fileid, filelog |
|
|||
81 | ) |
|
|||
82 |
|
|
83 | else: | |
83 |
|
|
84 | result = orig(lfutil.standin(path), fileid) | |
84 |
|
|
85 | olddata = result.data | |
85 |
|
|
86 | result.data = lambda: olddata() + b'\0' | |
86 |
|
|
87 | return result | |
87 |
|
88 | |||
88 | ctx.__class__ = lfilesctx |
|
89 | extensions.wrapfunction(ctx, 'filectx', filectx) | |
|
90 | ||||
89 | return ctx |
|
91 | return ctx | |
90 |
|
92 | |||
91 | # Figure out the status of big files and insert them into the |
|
93 | # Figure out the status of big files and insert them into the |
General Comments 0
You need to be logged in to leave comments.
Login now