Show More
@@ -8,7 +8,6 b'' | |||||
8 |
|
8 | |||
9 | '''setup for largefiles repositories: reposetup''' |
|
9 | '''setup for largefiles repositories: reposetup''' | |
10 | import copy |
|
10 | import copy | |
11 | import types |
|
|||
12 | import os |
|
11 | import os | |
13 |
|
12 | |||
14 | from mercurial import context, error, manifest, match as match_, util, \ |
|
13 | from mercurial import context, error, manifest, match as match_, util, \ | |
@@ -27,16 +26,6 b' def reposetup(ui, repo):' | |||||
27 | if not repo.local(): |
|
26 | if not repo.local(): | |
28 | return proto.wirereposetup(ui, repo) |
|
27 | return proto.wirereposetup(ui, repo) | |
29 |
|
28 | |||
30 | origclass = localrepo.localrepository |
|
|||
31 | repoclass = repo.__class__ |
|
|||
32 | for name in ('status', 'commitctx', 'commit', 'push'): |
|
|||
33 | if (getattr(origclass, name) != getattr(repoclass, name) or |
|
|||
34 | isinstance(getattr(repo, name), types.FunctionType)): |
|
|||
35 | ui.warn(_('largefiles: repo method %r appears to have already been' |
|
|||
36 | ' wrapped by another extension: ' |
|
|||
37 | 'largefiles may behave incorrectly\n') |
|
|||
38 | % name) |
|
|||
39 |
|
||||
40 | class lfilesrepo(repo.__class__): |
|
29 | class lfilesrepo(repo.__class__): | |
41 | lfstatus = False |
|
30 | lfstatus = False | |
42 | def status_nolfiles(self, *args, **kwargs): |
|
31 | def status_nolfiles(self, *args, **kwargs): |
@@ -180,34 +180,6 b' Test moving largefiles and verify that n' | |||||
180 | $ cat sub/large4 |
|
180 | $ cat sub/large4 | |
181 | large22 |
|
181 | large22 | |
182 |
|
182 | |||
183 | Test repo method wrapping detection |
|
|||
184 |
|
||||
185 | $ cat > $TESTTMP/wrapping1.py <<EOF |
|
|||
186 | > from hgext import largefiles |
|
|||
187 | > def reposetup(ui, repo): |
|
|||
188 | > class derived(repo.__class__): |
|
|||
189 | > def push(self, *args, **kwargs): |
|
|||
190 | > return super(derived, self).push(*args, **kwargs) |
|
|||
191 | > repo.__class__ = derived |
|
|||
192 | > largefiles.reposetup(ui, repo) |
|
|||
193 | > uisetup = largefiles.uisetup |
|
|||
194 | > EOF |
|
|||
195 | $ hg --config extensions.largefiles=$TESTTMP/wrapping1.py status |
|
|||
196 | largefiles: repo method 'push' appears to have already been wrapped by another extension: largefiles may behave incorrectly |
|
|||
197 |
|
||||
198 | $ cat > $TESTTMP/wrapping2.py <<EOF |
|
|||
199 | > from hgext import largefiles |
|
|||
200 | > def reposetup(ui, repo): |
|
|||
201 | > orgpush = repo.push |
|
|||
202 | > def push(*args, **kwargs): |
|
|||
203 | > return orgpush(*args, **kwargs) |
|
|||
204 | > repo.push = push |
|
|||
205 | > largefiles.reposetup(ui, repo) |
|
|||
206 | > uisetup = largefiles.uisetup |
|
|||
207 | > EOF |
|
|||
208 | $ hg --config extensions.largefiles=$TESTTMP/wrapping2.py status |
|
|||
209 | largefiles: repo method 'push' appears to have already been wrapped by another extension: largefiles may behave incorrectly |
|
|||
210 |
|
||||
211 | Test copies and moves from a directory other than root (issue3516) |
|
183 | Test copies and moves from a directory other than root (issue3516) | |
212 |
|
184 | |||
213 | $ cd .. |
|
185 | $ cd .. |
General Comments 0
You need to be logged in to leave comments.
Login now