Mercurial > hg
comparison hgext/largefiles/reposetup.py @ 23659:67d63ec85eb7
largefiles: look at unfiltered().lfstatus to allow status() to be filtered
The comment about status being buggy with a repo proxy seems to be that status
wasn't being redirected to testing the largefiles themselves- lfstatus was
always False, and so the original status method was being called instead of
doing the largefiles processing. This is because when the various largefile
command overrides call 'repo.lfstatus = True', __setattr__() in repoview is in
turn setting the value on the unfiltered repo, and the value in the filtered
repo remains False.
Explicitly looking at the attribute on the unfiltered repo keeps all views in
sync.
author | Matt Harbison <matt_harbison@yahoo.com> |
---|---|
date | Sun, 07 Dec 2014 01:32:30 -0500 |
parents | 4dd8a6a1240d |
children | 1ec6dbb9b216 |
comparison
equal
deleted
inserted
replaced
23658:55c92618fdd4 | 23659:67d63ec85eb7 |
---|---|
32 # of largefiles instead of their corresponding standins and | 32 # of largefiles instead of their corresponding standins and |
33 # identifies the largefiles as always binary, regardless of | 33 # identifies the largefiles as always binary, regardless of |
34 # their actual contents. | 34 # their actual contents. |
35 def __getitem__(self, changeid): | 35 def __getitem__(self, changeid): |
36 ctx = super(lfilesrepo, self).__getitem__(changeid) | 36 ctx = super(lfilesrepo, self).__getitem__(changeid) |
37 if self.lfstatus: | 37 if self.unfiltered().lfstatus: |
38 class lfilesmanifestdict(manifest.manifestdict): | 38 class lfilesmanifestdict(manifest.manifestdict): |
39 def __contains__(self, filename): | 39 def __contains__(self, filename): |
40 orig = super(lfilesmanifestdict, self).__contains__ | 40 orig = super(lfilesmanifestdict, self).__contains__ |
41 return orig(filename) or orig(lfutil.standin(filename)) | 41 return orig(filename) or orig(lfutil.standin(filename)) |
42 class lfilesctx(ctx.__class__): | 42 class lfilesctx(ctx.__class__): |
70 | 70 |
71 # Figure out the status of big files and insert them into the | 71 # Figure out the status of big files and insert them into the |
72 # appropriate list in the result. Also removes standin files | 72 # appropriate list in the result. Also removes standin files |
73 # from the listing. Revert to the original status if | 73 # from the listing. Revert to the original status if |
74 # self.lfstatus is False. | 74 # self.lfstatus is False. |
75 # XXX large file status is buggy when used on repo proxy. | |
76 # XXX this needs to be investigated. | |
77 @localrepo.unfilteredmethod | |
78 def status(self, node1='.', node2=None, match=None, ignored=False, | 75 def status(self, node1='.', node2=None, match=None, ignored=False, |
79 clean=False, unknown=False, listsubrepos=False): | 76 clean=False, unknown=False, listsubrepos=False): |
80 listignored, listclean, listunknown = ignored, clean, unknown | 77 listignored, listclean, listunknown = ignored, clean, unknown |
81 orig = super(lfilesrepo, self).status | 78 orig = super(lfilesrepo, self).status |
82 if not self.lfstatus: | 79 |
80 # When various overrides set repo.lfstatus, the change is redirected | |
81 # to the unfiltered repo, and self.lfstatus is always false when | |
82 # this repo is filtered. | |
83 if not self.unfiltered().lfstatus: | |
83 return orig(node1, node2, match, listignored, listclean, | 84 return orig(node1, node2, match, listignored, listclean, |
84 listunknown, listsubrepos) | 85 listunknown, listsubrepos) |
85 | 86 |
86 # some calls in this function rely on the old version of status | 87 # some calls in this function rely on the old version of status |
87 self.lfstatus = False | 88 self.unfiltered().lfstatus = False |
88 ctx1 = self[node1] | 89 ctx1 = self[node1] |
89 ctx2 = self[node2] | 90 ctx2 = self[node2] |
90 working = ctx2.rev() is None | 91 working = ctx2.rev() is None |
91 parentworking = working and ctx1 == self['.'] | 92 parentworking = working and ctx1 == self['.'] |
92 | 93 |
238 | 239 |
239 finally: | 240 finally: |
240 if wlock: | 241 if wlock: |
241 wlock.release() | 242 wlock.release() |
242 | 243 |
243 self.lfstatus = True | 244 self.unfiltered().lfstatus = True |
244 return scmutil.status(*result) | 245 return scmutil.status(*result) |
245 | 246 |
246 def commitctx(self, ctx, *args, **kwargs): | 247 def commitctx(self, ctx, *args, **kwargs): |
247 node = super(lfilesrepo, self).commitctx(ctx, *args, **kwargs) | 248 node = super(lfilesrepo, self).commitctx(ctx, *args, **kwargs) |
248 class lfilesctx(ctx.__class__): | 249 class lfilesctx(ctx.__class__): |