Show More
@@ -8,7 +8,6 b'' | |||
|
8 | 8 | |
|
9 | 9 | '''setup for largefiles repositories: reposetup''' |
|
10 | 10 | import copy |
|
11 | import types | |
|
12 | 11 | import os |
|
13 | 12 | |
|
14 | 13 | from mercurial import context, error, manifest, match as match_, util, \ |
@@ -27,16 +26,6 b' def reposetup(ui, repo):' | |||
|
27 | 26 | if not repo.local(): |
|
28 | 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 | 29 | class lfilesrepo(repo.__class__): |
|
41 | 30 | lfstatus = False |
|
42 | 31 | def status_nolfiles(self, *args, **kwargs): |
@@ -180,34 +180,6 b' Test moving largefiles and verify that n' | |||
|
180 | 180 | $ cat sub/large4 |
|
181 | 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 | 183 | Test copies and moves from a directory other than root (issue3516) |
|
212 | 184 | |
|
213 | 185 | $ cd .. |
General Comments 0
You need to be logged in to leave comments.
Login now