Show More
@@ -130,6 +130,7 b" testedwith = 'ships-with-hg-core'" | |||||
130 | eh = exthelper.exthelper() |
|
130 | eh = exthelper.exthelper() | |
131 | eh.merge(lfcommands.eh) |
|
131 | eh.merge(lfcommands.eh) | |
132 | eh.merge(overrides.eh) |
|
132 | eh.merge(overrides.eh) | |
|
133 | eh.merge(proto.eh) | |||
133 |
|
134 | |||
134 | eh.configitem('largefiles', 'minsize', |
|
135 | eh.configitem('largefiles', 'minsize', | |
135 | default=configitems.dynamicdefault, |
|
136 | default=configitems.dynamicdefault, |
@@ -14,19 +14,30 b' import os' | |||||
14 |
|
14 | |||
15 | from mercurial.i18n import _ |
|
15 | from mercurial.i18n import _ | |
16 |
|
16 | |||
|
17 | from mercurial.hgweb import ( | |||
|
18 | webcommands, | |||
|
19 | ) | |||
|
20 | ||||
17 | from mercurial import ( |
|
21 | from mercurial import ( | |
18 | archival, |
|
22 | archival, | |
19 | cmdutil, |
|
23 | cmdutil, | |
|
24 | copies as copiesmod, | |||
20 | error, |
|
25 | error, | |
|
26 | exchange, | |||
21 | exthelper, |
|
27 | exthelper, | |
|
28 | filemerge, | |||
22 | hg, |
|
29 | hg, | |
23 | logcmdutil, |
|
30 | logcmdutil, | |
24 | match as matchmod, |
|
31 | match as matchmod, | |
|
32 | merge, | |||
25 | pathutil, |
|
33 | pathutil, | |
26 | pycompat, |
|
34 | pycompat, | |
27 | registrar, |
|
35 | registrar, | |
28 | scmutil, |
|
36 | scmutil, | |
29 | smartset, |
|
37 | smartset, | |
|
38 | subrepo, | |||
|
39 | upgrade, | |||
|
40 | url as urlmod, | |||
30 | util, |
|
41 | util, | |
31 | ) |
|
42 | ) | |
32 |
|
43 | |||
@@ -251,6 +262,7 b' def removelargefiles(ui, repo, isaddremo' | |||||
251 |
|
262 | |||
252 | # For overriding mercurial.hgweb.webcommands so that largefiles will |
|
263 | # For overriding mercurial.hgweb.webcommands so that largefiles will | |
253 | # appear at their right place in the manifests. |
|
264 | # appear at their right place in the manifests. | |
|
265 | @eh.wrapfunction(webcommands, 'decodepath') | |||
254 | def decodepath(orig, path): |
|
266 | def decodepath(orig, path): | |
255 | return lfutil.splitstandin(path) or path |
|
267 | return lfutil.splitstandin(path) or path | |
256 |
|
268 | |||
@@ -266,6 +278,7 b' def overrideadd(orig, ui, repo, *pats, *' | |||||
266 | raise error.Abort(_('--normal cannot be used with --large')) |
|
278 | raise error.Abort(_('--normal cannot be used with --large')) | |
267 | return orig(ui, repo, *pats, **opts) |
|
279 | return orig(ui, repo, *pats, **opts) | |
268 |
|
280 | |||
|
281 | @eh.wrapfunction(cmdutil, 'add') | |||
269 | def cmdutiladd(orig, ui, repo, matcher, prefix, explicitonly, **opts): |
|
282 | def cmdutiladd(orig, ui, repo, matcher, prefix, explicitonly, **opts): | |
270 | # The --normal flag short circuits this override |
|
283 | # The --normal flag short circuits this override | |
271 | if opts.get(r'normal'): |
|
284 | if opts.get(r'normal'): | |
@@ -279,6 +292,7 b' def cmdutiladd(orig, ui, repo, matcher, ' | |||||
279 | bad.extend(f for f in lbad) |
|
292 | bad.extend(f for f in lbad) | |
280 | return bad |
|
293 | return bad | |
281 |
|
294 | |||
|
295 | @eh.wrapfunction(cmdutil, 'remove') | |||
282 | def cmdutilremove(orig, ui, repo, matcher, prefix, after, force, subrepos, |
|
296 | def cmdutilremove(orig, ui, repo, matcher, prefix, after, force, subrepos, | |
283 | dryrun): |
|
297 | dryrun): | |
284 | normalmatcher = composenormalfilematcher(matcher, repo[None].manifest()) |
|
298 | normalmatcher = composenormalfilematcher(matcher, repo[None].manifest()) | |
@@ -287,6 +301,7 b' def cmdutilremove(orig, ui, repo, matche' | |||||
287 | return removelargefiles(ui, repo, False, matcher, dryrun, after=after, |
|
301 | return removelargefiles(ui, repo, False, matcher, dryrun, after=after, | |
288 | force=force) or result |
|
302 | force=force) or result | |
289 |
|
303 | |||
|
304 | @eh.wrapfunction(subrepo.hgsubrepo, 'status') | |||
290 | def overridestatusfn(orig, repo, rev2, **opts): |
|
305 | def overridestatusfn(orig, repo, rev2, **opts): | |
291 | try: |
|
306 | try: | |
292 | repo._repo.lfstatus = True |
|
307 | repo._repo.lfstatus = True | |
@@ -302,6 +317,7 b' def overridestatus(orig, ui, repo, *pats' | |||||
302 | finally: |
|
317 | finally: | |
303 | repo.lfstatus = False |
|
318 | repo.lfstatus = False | |
304 |
|
319 | |||
|
320 | @eh.wrapfunction(subrepo.hgsubrepo, 'dirty') | |||
305 | def overridedirty(orig, repo, ignoreupdate=False, missing=False): |
|
321 | def overridedirty(orig, repo, ignoreupdate=False, missing=False): | |
306 | try: |
|
322 | try: | |
307 | repo._repo.lfstatus = True |
|
323 | repo._repo.lfstatus = True | |
@@ -454,6 +470,7 b' def overridedebugstate(orig, ui, repo, *' | |||||
454 | # The overridden function filters the unknown files by removing any |
|
470 | # The overridden function filters the unknown files by removing any | |
455 | # largefiles. This makes the merge proceed and we can then handle this |
|
471 | # largefiles. This makes the merge proceed and we can then handle this | |
456 | # case further in the overridden calculateupdates function below. |
|
472 | # case further in the overridden calculateupdates function below. | |
|
473 | @eh.wrapfunction(merge, '_checkunknownfile') | |||
457 | def overridecheckunknownfile(origfn, repo, wctx, mctx, f, f2=None): |
|
474 | def overridecheckunknownfile(origfn, repo, wctx, mctx, f, f2=None): | |
458 | if lfutil.standin(repo.dirstate.normalize(f)) in wctx: |
|
475 | if lfutil.standin(repo.dirstate.normalize(f)) in wctx: | |
459 | return False |
|
476 | return False | |
@@ -485,6 +502,7 b' def overridecheckunknownfile(origfn, rep' | |||||
485 | # Finally, the merge.applyupdates function will then take care of |
|
502 | # Finally, the merge.applyupdates function will then take care of | |
486 | # writing the files into the working copy and lfcommands.updatelfiles |
|
503 | # writing the files into the working copy and lfcommands.updatelfiles | |
487 | # will update the largefiles. |
|
504 | # will update the largefiles. | |
|
505 | @eh.wrapfunction(merge, 'calculateupdates') | |||
488 | def overridecalculateupdates(origfn, repo, p1, p2, pas, branchmerge, force, |
|
506 | def overridecalculateupdates(origfn, repo, p1, p2, pas, branchmerge, force, | |
489 | acceptremote, *args, **kwargs): |
|
507 | acceptremote, *args, **kwargs): | |
490 | overwrite = force and not branchmerge |
|
508 | overwrite = force and not branchmerge | |
@@ -553,6 +571,7 b' def overridecalculateupdates(origfn, rep' | |||||
553 |
|
571 | |||
554 | return actions, diverge, renamedelete |
|
572 | return actions, diverge, renamedelete | |
555 |
|
573 | |||
|
574 | @eh.wrapfunction(merge, 'recordupdates') | |||
556 | def mergerecordupdates(orig, repo, actions, branchmerge): |
|
575 | def mergerecordupdates(orig, repo, actions, branchmerge): | |
557 | if 'lfmr' in actions: |
|
576 | if 'lfmr' in actions: | |
558 | lfdirstate = lfutil.openlfdirstate(repo.ui, repo) |
|
577 | lfdirstate = lfutil.openlfdirstate(repo.ui, repo) | |
@@ -568,6 +587,7 b' def mergerecordupdates(orig, repo, actio' | |||||
568 |
|
587 | |||
569 | # Override filemerge to prompt the user about how they wish to merge |
|
588 | # Override filemerge to prompt the user about how they wish to merge | |
570 | # largefiles. This will handle identical edits without prompting the user. |
|
589 | # largefiles. This will handle identical edits without prompting the user. | |
|
590 | @eh.wrapfunction(filemerge, '_filemerge') | |||
571 | def overridefilemerge(origfn, premerge, repo, wctx, mynode, orig, fcd, fco, fca, |
|
591 | def overridefilemerge(origfn, premerge, repo, wctx, mynode, orig, fcd, fco, fca, | |
572 | labels=None): |
|
592 | labels=None): | |
573 | if not lfutil.isstandin(orig) or fcd.isabsent() or fco.isabsent(): |
|
593 | if not lfutil.isstandin(orig) or fcd.isabsent() or fco.isabsent(): | |
@@ -589,6 +609,7 b' def overridefilemerge(origfn, premerge, ' | |||||
589 | repo.wwrite(fcd.path(), fco.data(), fco.flags()) |
|
609 | repo.wwrite(fcd.path(), fco.data(), fco.flags()) | |
590 | return True, 0, False |
|
610 | return True, 0, False | |
591 |
|
611 | |||
|
612 | @eh.wrapfunction(copiesmod, 'pathcopies') | |||
592 | def copiespathcopies(orig, ctx1, ctx2, match=None): |
|
613 | def copiespathcopies(orig, ctx1, ctx2, match=None): | |
593 | copies = orig(ctx1, ctx2, match=match) |
|
614 | copies = orig(ctx1, ctx2, match=match) | |
594 | updated = {} |
|
615 | updated = {} | |
@@ -603,6 +624,7 b' def copiespathcopies(orig, ctx1, ctx2, m' | |||||
603 | # checks if the destination largefile already exists. It also keeps a |
|
624 | # checks if the destination largefile already exists. It also keeps a | |
604 | # list of copied files so that the largefiles can be copied and the |
|
625 | # list of copied files so that the largefiles can be copied and the | |
605 | # dirstate updated. |
|
626 | # dirstate updated. | |
|
627 | @eh.wrapfunction(cmdutil, 'copy') | |||
606 | def overridecopy(orig, ui, repo, pats, opts, rename=False): |
|
628 | def overridecopy(orig, ui, repo, pats, opts, rename=False): | |
607 | # doesn't remove largefile on rename |
|
629 | # doesn't remove largefile on rename | |
608 | if len(pats) < 2: |
|
630 | if len(pats) < 2: | |
@@ -748,6 +770,7 b' def overridecopy(orig, ui, repo, pats, o' | |||||
748 | # commits. Update the standins then run the original revert, changing |
|
770 | # commits. Update the standins then run the original revert, changing | |
749 | # the matcher to hit standins instead of largefiles. Based on the |
|
771 | # the matcher to hit standins instead of largefiles. Based on the | |
750 | # resulting standins update the largefiles. |
|
772 | # resulting standins update the largefiles. | |
|
773 | @eh.wrapfunction(cmdutil, 'revert') | |||
751 | def overriderevert(orig, ui, repo, ctx, parents, *pats, **opts): |
|
774 | def overriderevert(orig, ui, repo, ctx, parents, *pats, **opts): | |
752 | # Because we put the standins in a bad state (by updating them) |
|
775 | # Because we put the standins in a bad state (by updating them) | |
753 | # and then return them to a correct state we need to lock to |
|
776 | # and then return them to a correct state we need to lock to | |
@@ -857,6 +880,7 b' def overridepush(orig, ui, repo, *args, ' | |||||
857 | opargs['lfrevs'] = scmutil.revrange(repo, lfrevs) |
|
880 | opargs['lfrevs'] = scmutil.revrange(repo, lfrevs) | |
858 | return orig(ui, repo, *args, **kwargs) |
|
881 | return orig(ui, repo, *args, **kwargs) | |
859 |
|
882 | |||
|
883 | @eh.wrapfunction(exchange, 'pushoperation') | |||
860 | def exchangepushoperation(orig, *args, **kwargs): |
|
884 | def exchangepushoperation(orig, *args, **kwargs): | |
861 | """Override pushoperation constructor and store lfrevs parameter""" |
|
885 | """Override pushoperation constructor and store lfrevs parameter""" | |
862 | lfrevs = kwargs.pop(r'lfrevs', None) |
|
886 | lfrevs = kwargs.pop(r'lfrevs', None) | |
@@ -906,6 +930,7 b' def overrideclone(orig, ui, source, dest' | |||||
906 |
|
930 | |||
907 | return orig(ui, source, dest, **opts) |
|
931 | return orig(ui, source, dest, **opts) | |
908 |
|
932 | |||
|
933 | @eh.wrapfunction(hg, 'clone') | |||
909 | def hgclone(orig, ui, opts, *args, **kwargs): |
|
934 | def hgclone(orig, ui, opts, *args, **kwargs): | |
910 | result = orig(ui, opts, *args, **kwargs) |
|
935 | result = orig(ui, opts, *args, **kwargs) | |
911 |
|
936 | |||
@@ -953,6 +978,7 b' def overridearchivecmd(orig, ui, repo, d' | |||||
953 | finally: |
|
978 | finally: | |
954 | repo.unfiltered().lfstatus = False |
|
979 | repo.unfiltered().lfstatus = False | |
955 |
|
980 | |||
|
981 | @eh.wrapfunction(webcommands, 'archive') | |||
956 | def hgwebarchive(orig, web): |
|
982 | def hgwebarchive(orig, web): | |
957 | web.repo.lfstatus = True |
|
983 | web.repo.lfstatus = True | |
958 |
|
984 | |||
@@ -961,6 +987,7 b' def hgwebarchive(orig, web):' | |||||
961 | finally: |
|
987 | finally: | |
962 | web.repo.lfstatus = False |
|
988 | web.repo.lfstatus = False | |
963 |
|
989 | |||
|
990 | @eh.wrapfunction(archival, 'archive') | |||
964 | def overridearchive(orig, repo, dest, node, kind, decode=True, match=None, |
|
991 | def overridearchive(orig, repo, dest, node, kind, decode=True, match=None, | |
965 | prefix='', mtime=None, subrepos=None): |
|
992 | prefix='', mtime=None, subrepos=None): | |
966 | # For some reason setting repo.lfstatus in hgwebarchive only changes the |
|
993 | # For some reason setting repo.lfstatus in hgwebarchive only changes the | |
@@ -1029,6 +1056,7 b' def overridearchive(orig, repo, dest, no' | |||||
1029 |
|
1056 | |||
1030 | archiver.done() |
|
1057 | archiver.done() | |
1031 |
|
1058 | |||
|
1059 | @eh.wrapfunction(subrepo.hgsubrepo, 'archive') | |||
1032 | def hgsubrepoarchive(orig, repo, archiver, prefix, match=None, decode=True): |
|
1060 | def hgsubrepoarchive(orig, repo, archiver, prefix, match=None, decode=True): | |
1033 | lfenabled = util.safehasattr(repo._repo, '_largefilesenabled') |
|
1061 | lfenabled = util.safehasattr(repo._repo, '_largefilesenabled') | |
1034 | if not lfenabled or not repo._repo.lfstatus: |
|
1062 | if not lfenabled or not repo._repo.lfstatus: | |
@@ -1083,6 +1111,7 b' def hgsubrepoarchive(orig, repo, archive' | |||||
1083 | # standin until a commit. cmdutil.bailifchanged() raises an exception |
|
1111 | # standin until a commit. cmdutil.bailifchanged() raises an exception | |
1084 | # if the repo has uncommitted changes. Wrap it to also check if |
|
1112 | # if the repo has uncommitted changes. Wrap it to also check if | |
1085 | # largefiles were changed. This is used by bisect, backout and fetch. |
|
1113 | # largefiles were changed. This is used by bisect, backout and fetch. | |
|
1114 | @eh.wrapfunction(cmdutil, 'bailifchanged') | |||
1086 | def overridebailifchanged(orig, repo, *args, **kwargs): |
|
1115 | def overridebailifchanged(orig, repo, *args, **kwargs): | |
1087 | orig(repo, *args, **kwargs) |
|
1116 | orig(repo, *args, **kwargs) | |
1088 | repo.lfstatus = True |
|
1117 | repo.lfstatus = True | |
@@ -1091,6 +1120,7 b' def overridebailifchanged(orig, repo, *a' | |||||
1091 | if s.modified or s.added or s.removed or s.deleted: |
|
1120 | if s.modified or s.added or s.removed or s.deleted: | |
1092 | raise error.Abort(_('uncommitted changes')) |
|
1121 | raise error.Abort(_('uncommitted changes')) | |
1093 |
|
1122 | |||
|
1123 | @eh.wrapfunction(cmdutil, 'postcommitstatus') | |||
1094 | def postcommitstatus(orig, repo, *args, **kwargs): |
|
1124 | def postcommitstatus(orig, repo, *args, **kwargs): | |
1095 | repo.lfstatus = True |
|
1125 | repo.lfstatus = True | |
1096 | try: |
|
1126 | try: | |
@@ -1098,6 +1128,7 b' def postcommitstatus(orig, repo, *args, ' | |||||
1098 | finally: |
|
1128 | finally: | |
1099 | repo.lfstatus = False |
|
1129 | repo.lfstatus = False | |
1100 |
|
1130 | |||
|
1131 | @eh.wrapfunction(cmdutil, 'forget') | |||
1101 | def cmdutilforget(orig, ui, repo, match, prefix, explicitonly, dryrun, |
|
1132 | def cmdutilforget(orig, ui, repo, match, prefix, explicitonly, dryrun, | |
1102 | interactive): |
|
1133 | interactive): | |
1103 | normalmatcher = composenormalfilematcher(match, repo[None].manifest()) |
|
1134 | normalmatcher = composenormalfilematcher(match, repo[None].manifest()) | |
@@ -1244,6 +1275,7 b' def overridesummary(orig, ui, repo, *pat' | |||||
1244 | finally: |
|
1275 | finally: | |
1245 | repo.lfstatus = False |
|
1276 | repo.lfstatus = False | |
1246 |
|
1277 | |||
|
1278 | @eh.wrapfunction(scmutil, 'addremove') | |||
1247 | def scmutiladdremove(orig, repo, matcher, prefix, opts=None): |
|
1279 | def scmutiladdremove(orig, repo, matcher, prefix, opts=None): | |
1248 | if opts is None: |
|
1280 | if opts is None: | |
1249 | opts = {} |
|
1281 | opts = {} | |
@@ -1420,6 +1452,7 b' def overridecat(orig, ui, repo, file1, *' | |||||
1420 | err = 0 |
|
1452 | err = 0 | |
1421 | return err |
|
1453 | return err | |
1422 |
|
1454 | |||
|
1455 | @eh.wrapfunction(merge, 'update') | |||
1423 | def mergeupdate(orig, repo, node, branchmerge, force, |
|
1456 | def mergeupdate(orig, repo, node, branchmerge, force, | |
1424 | *args, **kwargs): |
|
1457 | *args, **kwargs): | |
1425 | matcher = kwargs.get(r'matcher', None) |
|
1458 | matcher = kwargs.get(r'matcher', None) | |
@@ -1497,6 +1530,7 b' def mergeupdate(orig, repo, node, branch' | |||||
1497 |
|
1530 | |||
1498 | return result |
|
1531 | return result | |
1499 |
|
1532 | |||
|
1533 | @eh.wrapfunction(scmutil, 'marktouched') | |||
1500 | def scmutilmarktouched(orig, repo, files, *args, **kwargs): |
|
1534 | def scmutilmarktouched(orig, repo, files, *args, **kwargs): | |
1501 | result = orig(repo, files, *args, **kwargs) |
|
1535 | result = orig(repo, files, *args, **kwargs) | |
1502 |
|
1536 | |||
@@ -1511,6 +1545,8 b' def scmutilmarktouched(orig, repo, files' | |||||
1511 |
|
1545 | |||
1512 | return result |
|
1546 | return result | |
1513 |
|
1547 | |||
|
1548 | @eh.wrapfunction(upgrade, 'preservedrequirements') | |||
|
1549 | @eh.wrapfunction(upgrade, 'supporteddestrequirements') | |||
1514 | def upgraderequirements(orig, repo): |
|
1550 | def upgraderequirements(orig, repo): | |
1515 | reqs = orig(repo) |
|
1551 | reqs = orig(repo) | |
1516 | if 'largefiles' in repo.requirements: |
|
1552 | if 'largefiles' in repo.requirements: | |
@@ -1518,6 +1554,8 b' def upgraderequirements(orig, repo):' | |||||
1518 | return reqs |
|
1554 | return reqs | |
1519 |
|
1555 | |||
1520 | _lfscheme = 'largefile://' |
|
1556 | _lfscheme = 'largefile://' | |
|
1557 | ||||
|
1558 | @eh.wrapfunction(urlmod, 'open') | |||
1521 | def openlargefile(orig, ui, url_, data=None): |
|
1559 | def openlargefile(orig, ui, url_, data=None): | |
1522 | if url_.startswith(_lfscheme): |
|
1560 | if url_.startswith(_lfscheme): | |
1523 | if data: |
|
1561 | if data: |
@@ -11,10 +11,12 b' from mercurial.i18n import _' | |||||
11 |
|
11 | |||
12 | from mercurial import ( |
|
12 | from mercurial import ( | |
13 | error, |
|
13 | error, | |
|
14 | exthelper, | |||
14 | httppeer, |
|
15 | httppeer, | |
15 | util, |
|
16 | util, | |
16 | wireprototypes, |
|
17 | wireprototypes, | |
17 | wireprotov1peer, |
|
18 | wireprotov1peer, | |
|
19 | wireprotov1server, | |||
18 | ) |
|
20 | ) | |
19 |
|
21 | |||
20 | from . import ( |
|
22 | from . import ( | |
@@ -28,6 +30,8 b" LARGEFILES_REQUIRED_MSG = ('\\nThis repos" | |||||
28 | '\n\nPlease enable it in your Mercurial config ' |
|
30 | '\n\nPlease enable it in your Mercurial config ' | |
29 | 'file.\n') |
|
31 | 'file.\n') | |
30 |
|
32 | |||
|
33 | eh = exthelper.exthelper() | |||
|
34 | ||||
31 | # these will all be replaced by largefiles.uisetup |
|
35 | # these will all be replaced by largefiles.uisetup | |
32 | ssholdcallstream = None |
|
36 | ssholdcallstream = None | |
33 | httpoldcallstream = None |
|
37 | httpoldcallstream = None | |
@@ -162,6 +166,7 b' def wirereposetup(ui, repo):' | |||||
162 | repo.__class__ = lfileswirerepository |
|
166 | repo.__class__ = lfileswirerepository | |
163 |
|
167 | |||
164 | # advertise the largefiles=serve capability |
|
168 | # advertise the largefiles=serve capability | |
|
169 | @eh.wrapfunction(wireprotov1server, '_capabilities') | |||
165 | def _capabilities(orig, repo, proto): |
|
170 | def _capabilities(orig, repo, proto): | |
166 | '''announce largefile server capability''' |
|
171 | '''announce largefile server capability''' | |
167 | caps = orig(repo, proto) |
|
172 | caps = orig(repo, proto) |
@@ -9,25 +9,11 b'' | |||||
9 | '''setup for largefiles extension: uisetup''' |
|
9 | '''setup for largefiles extension: uisetup''' | |
10 | from __future__ import absolute_import |
|
10 | from __future__ import absolute_import | |
11 |
|
11 | |||
12 | from mercurial.hgweb import ( |
|
|||
13 | webcommands, |
|
|||
14 | ) |
|
|||
15 |
|
||||
16 | from mercurial import ( |
|
12 | from mercurial import ( | |
17 | archival, |
|
|||
18 | cmdutil, |
|
13 | cmdutil, | |
19 | copies, |
|
|||
20 | exchange, |
|
|||
21 | extensions, |
|
14 | extensions, | |
22 | filemerge, |
|
|||
23 | hg, |
|
|||
24 | httppeer, |
|
15 | httppeer, | |
25 | merge, |
|
|||
26 | scmutil, |
|
|||
27 | sshpeer, |
|
16 | sshpeer, | |
28 | subrepo, |
|
|||
29 | upgrade, |
|
|||
30 | url, |
|
|||
31 | wireprotov1server, |
|
17 | wireprotov1server, | |
32 | ) |
|
18 | ) | |
33 |
|
19 | |||
@@ -37,67 +23,10 b' from . import (' | |||||
37 | ) |
|
23 | ) | |
38 |
|
24 | |||
39 | def uisetup(ui): |
|
25 | def uisetup(ui): | |
40 | # Disable auto-status for some commands which assume that all |
|
|||
41 | # files in the result are under Mercurial's control |
|
|||
42 |
|
||||
43 | # The scmutil function is called both by the (trivial) addremove command, |
|
|||
44 | # and in the process of handling commit -A (issue3542) |
|
|||
45 | extensions.wrapfunction(scmutil, 'addremove', overrides.scmutiladdremove) |
|
|||
46 | extensions.wrapfunction(cmdutil, 'add', overrides.cmdutiladd) |
|
|||
47 | extensions.wrapfunction(cmdutil, 'remove', overrides.cmdutilremove) |
|
|||
48 | extensions.wrapfunction(cmdutil, 'forget', overrides.cmdutilforget) |
|
|||
49 |
|
||||
50 | extensions.wrapfunction(copies, 'pathcopies', overrides.copiespathcopies) |
|
|||
51 |
|
||||
52 | extensions.wrapfunction(upgrade, 'preservedrequirements', |
|
|||
53 | overrides.upgraderequirements) |
|
|||
54 |
|
||||
55 | extensions.wrapfunction(upgrade, 'supporteddestrequirements', |
|
|||
56 | overrides.upgraderequirements) |
|
|||
57 |
|
||||
58 | # Subrepos call status function |
|
|||
59 | extensions.wrapfunction(subrepo.hgsubrepo, 'status', |
|
|||
60 | overrides.overridestatusfn) |
|
|||
61 |
|
26 | |||
62 | cmdutil.outgoinghooks.add('largefiles', overrides.outgoinghook) |
|
27 | cmdutil.outgoinghooks.add('largefiles', overrides.outgoinghook) | |
63 | cmdutil.summaryremotehooks.add('largefiles', overrides.summaryremotehook) |
|
28 | cmdutil.summaryremotehooks.add('largefiles', overrides.summaryremotehook) | |
64 |
|
29 | |||
65 | extensions.wrapfunction(exchange, 'pushoperation', |
|
|||
66 | overrides.exchangepushoperation) |
|
|||
67 |
|
||||
68 | extensions.wrapfunction(hg, 'clone', overrides.hgclone) |
|
|||
69 |
|
||||
70 | extensions.wrapfunction(merge, '_checkunknownfile', |
|
|||
71 | overrides.overridecheckunknownfile) |
|
|||
72 | extensions.wrapfunction(merge, 'calculateupdates', |
|
|||
73 | overrides.overridecalculateupdates) |
|
|||
74 | extensions.wrapfunction(merge, 'recordupdates', |
|
|||
75 | overrides.mergerecordupdates) |
|
|||
76 | extensions.wrapfunction(merge, 'update', overrides.mergeupdate) |
|
|||
77 | extensions.wrapfunction(filemerge, '_filemerge', |
|
|||
78 | overrides.overridefilemerge) |
|
|||
79 | extensions.wrapfunction(cmdutil, 'copy', overrides.overridecopy) |
|
|||
80 |
|
||||
81 | # Summary calls dirty on the subrepos |
|
|||
82 | extensions.wrapfunction(subrepo.hgsubrepo, 'dirty', overrides.overridedirty) |
|
|||
83 |
|
||||
84 | extensions.wrapfunction(cmdutil, 'revert', overrides.overriderevert) |
|
|||
85 |
|
||||
86 | extensions.wrapfunction(archival, 'archive', overrides.overridearchive) |
|
|||
87 | extensions.wrapfunction(subrepo.hgsubrepo, 'archive', |
|
|||
88 | overrides.hgsubrepoarchive) |
|
|||
89 | extensions.wrapfunction(webcommands, 'archive', overrides.hgwebarchive) |
|
|||
90 | extensions.wrapfunction(cmdutil, 'bailifchanged', |
|
|||
91 | overrides.overridebailifchanged) |
|
|||
92 |
|
||||
93 | extensions.wrapfunction(cmdutil, 'postcommitstatus', |
|
|||
94 | overrides.postcommitstatus) |
|
|||
95 | extensions.wrapfunction(scmutil, 'marktouched', |
|
|||
96 | overrides.scmutilmarktouched) |
|
|||
97 |
|
||||
98 | extensions.wrapfunction(url, 'open', |
|
|||
99 | overrides.openlargefile) |
|
|||
100 |
|
||||
101 | # create the new wireproto commands ... |
|
30 | # create the new wireproto commands ... | |
102 | wireprotov1server.wireprotocommand('putlfile', 'sha', permission='push')( |
|
31 | wireprotov1server.wireprotocommand('putlfile', 'sha', permission='push')( | |
103 | proto.putlfile) |
|
32 | proto.putlfile) | |
@@ -108,16 +37,10 b' def uisetup(ui):' | |||||
108 | wireprotov1server.wireprotocommand('lheads', '', permission='pull')( |
|
37 | wireprotov1server.wireprotocommand('lheads', '', permission='pull')( | |
109 | wireprotov1server.heads) |
|
38 | wireprotov1server.heads) | |
110 |
|
39 | |||
111 | # ... and wrap some existing ones |
|
|||
112 | extensions.wrapfunction(wireprotov1server.commands['heads'], 'func', |
|
40 | extensions.wrapfunction(wireprotov1server.commands['heads'], 'func', | |
113 | proto.heads) |
|
41 | proto.heads) | |
114 | # TODO also wrap wireproto.commandsv2 once heads is implemented there. |
|
42 | # TODO also wrap wireproto.commandsv2 once heads is implemented there. | |
115 |
|
43 | |||
116 | extensions.wrapfunction(webcommands, 'decodepath', overrides.decodepath) |
|
|||
117 |
|
||||
118 | extensions.wrapfunction(wireprotov1server, '_capabilities', |
|
|||
119 | proto._capabilities) |
|
|||
120 |
|
||||
121 | # can't do this in reposetup because it needs to have happened before |
|
44 | # can't do this in reposetup because it needs to have happened before | |
122 | # wirerepo.__init__ is called |
|
45 | # wirerepo.__init__ is called | |
123 | proto.ssholdcallstream = sshpeer.sshv1peer._callstream |
|
46 | proto.ssholdcallstream = sshpeer.sshv1peer._callstream | |
@@ -128,5 +51,6 b' def uisetup(ui):' | |||||
128 | # override some extensions' stuff as well |
|
51 | # override some extensions' stuff as well | |
129 | for name, module in extensions.extensions(): |
|
52 | for name, module in extensions.extensions(): | |
130 | if name == 'rebase': |
|
53 | if name == 'rebase': | |
|
54 | # TODO: teach exthelper to handle this | |||
131 | extensions.wrapfunction(module, 'rebase', |
|
55 | extensions.wrapfunction(module, 'rebase', | |
132 | overrides.overriderebase) |
|
56 | overrides.overriderebase) |
General Comments 0
You need to be logged in to leave comments.
Login now