##// END OF EJS Templates
tests: use NO_CHECK_EOF for fragments used to test importing via extension...
tests: use NO_CHECK_EOF for fragments used to test importing via extension test-extension.t is excluded in test-check-module-imports.t, because import-checker.py reports that some python code fragments in it does not import modules in recommended style. These code fragments are used to test importing modules relatively and absolutely via extension (e.g. issue4029, issue5208, and so on). Test specific package hierarchy becomes complicated for this purpose, and it seems reasonable to avoid checking these code fragments with import-checker.py. But on the other hand, other code fragments in test-extension.t should be checked by import-checker.py. Therefore, this patch uses NO_CHECK_EOF limit mark only for python code fragments, which are used to test importing via extension in test-extension.t. NO_CHECK_EOF limit mark tells import-checker.py that this code fragment should be ignored, via testparseutil.py.

File last commit:

r39890:823a5804 default
r40242:37295cee default
Show More
uisetup.py
204 lines | 8.5 KiB | text/x-python | PythonLexer
various
hgext: add largefiles extension...
r15168 # Copyright 2009-2010 Gregory P. Ward
# Copyright 2009-2010 Intelerad Medical Systems Incorporated
# Copyright 2010-2011 Fog Creek Software
# Copyright 2010-2011 Unity Technologies
#
# This software may be used and distributed according to the terms of the
# GNU General Public License version 2 or any later version.
'''setup for largefiles extension: uisetup'''
liscju
py3: make largefiles/uisetup.py use absolute_import
r29315 from __future__ import absolute_import
various
hgext: add largefiles extension...
r15168
from mercurial.i18n import _
liscju
py3: make largefiles/uisetup.py use absolute_import
r29315
from mercurial.hgweb import (
webcommands,
)
various
hgext: add largefiles extension...
r15168
liscju
py3: make largefiles/uisetup.py use absolute_import
r29315 from mercurial import (
archival,
cmdutil,
commands,
copies,
exchange,
extensions,
filemerge,
hg,
httppeer,
merge,
scmutil,
sshpeer,
subrepo,
Boris Feld
largefiles: allow to run 'debugupgraderepo' on repo with largefiles...
r35304 upgrade,
Boris Feld
largefiles: add support for 'largefiles://' url scheme...
r35580 url,
Gregory Szorc
wireproto: rename wireproto to wireprotov1server (API)...
r37803 wireprotov1server,
liscju
py3: make largefiles/uisetup.py use absolute_import
r29315 )
from . import (
overrides,
proto,
)
various
hgext: add largefiles extension...
r15168
def uisetup(ui):
# Disable auto-status for some commands which assume that all
# files in the result are under Mercurial's control
Matt Mackall
largefiles: fix over-long lines
r15170 entry = extensions.wrapcommand(commands.table, 'add',
Na'Tosha Bard
largefiles: remove use of underscores that breaks coding convention
r16247 overrides.overrideadd)
various
hgext: add largefiles extension...
r15168 addopt = [('', 'large', None, _('add as largefile')),
Na'Tosha Bard
largefiles: add --normal option to hg add (issue3061)
r15944 ('', 'normal', None, _('add as normal file')),
Martin Geisler
largefiles: fix indentation
r15627 ('', 'lfsize', '', _('add all files above this size '
'(in megabytes) as largefiles '
'(default: 10)'))]
various
hgext: add largefiles extension...
r15168 entry[1].extend(addopt)
Matt Harbison
largefiles: handle commit -A properly, after a --large commit (issue3542)...
r17658 # The scmutil function is called both by the (trivial) addremove command,
# and in the process of handling commit -A (issue3542)
Martin von Zweigbergk
largefiles: remove unused assignments from wrapfunction()...
r34077 extensions.wrapfunction(scmutil, 'addremove', overrides.scmutiladdremove)
Matt Harbison
largefiles: enable subrepo support for add...
r23886 extensions.wrapfunction(cmdutil, 'add', overrides.cmdutiladd)
Matt Harbison
largefiles: enable subrepo support for remove...
r23782 extensions.wrapfunction(cmdutil, 'remove', overrides.cmdutilremove)
Matt Harbison
largefiles: enable subrepo support for forget
r23837 extensions.wrapfunction(cmdutil, 'forget', overrides.cmdutilforget)
Matt Harbison
largefiles: fix status -S reporting of subrepos (issue3231)...
r16515
Matt Harbison
largefiles: report the source of copied/moved largefiles in status -C...
r24230 extensions.wrapfunction(copies, 'pathcopies', overrides.copiespathcopies)
Boris Feld
largefiles: allow to run 'debugupgraderepo' on repo with largefiles...
r35304 extensions.wrapfunction(upgrade, 'preservedrequirements',
overrides.upgraderequirements)
extensions.wrapfunction(upgrade, 'supporteddestrequirements',
overrides.upgraderequirements)
Matt Harbison
largefiles: fix status -S reporting of subrepos (issue3231)...
r16515 # Subrepos call status function
Matt Mackall
largefiles: fix over-long lines
r15170 entry = extensions.wrapcommand(commands.table, 'status',
Na'Tosha Bard
largefiles: remove use of underscores that breaks coding convention
r16247 overrides.overridestatus)
Martin von Zweigbergk
largefiles: remove unused assignments from wrapfunction()...
r34077 extensions.wrapfunction(subrepo.hgsubrepo, 'status',
overrides.overridestatusfn)
Matt Harbison
largefiles: fix status -S reporting of subrepos (issue3231)...
r16515
Matt Mackall
largefiles: fix over-long lines
r15170 entry = extensions.wrapcommand(commands.table, 'log',
Na'Tosha Bard
largefiles: remove use of underscores that breaks coding convention
r16247 overrides.overridelog)
various
hgext: add largefiles extension...
r15168 entry = extensions.wrapcommand(commands.table, 'rollback',
Na'Tosha Bard
largefiles: remove use of underscores that breaks coding convention
r16247 overrides.overriderollback)
Matt Mackall
largefiles: fix over-long lines
r15170 entry = extensions.wrapcommand(commands.table, 'verify',
Na'Tosha Bard
largefiles: remove use of underscores that breaks coding convention
r16247 overrides.overrideverify)
various
hgext: add largefiles extension...
r15168
Mads Kiilerich
largefiles: make verify --lfa and --lfc work without --large...
r18547 verifyopt = [('', 'large', None,
_('verify that all largefiles in current revision exists')),
various
hgext: add largefiles extension...
r15168 ('', 'lfa', None,
Mads Kiilerich
largefiles: make verify --lfa and --lfc work without --large...
r18547 _('verify largefiles in all revisions, not just current')),
various
hgext: add largefiles extension...
r15168 ('', 'lfc', None,
Mads Kiilerich
largefiles: make verify --lfa and --lfc work without --large...
r18547 _('verify local largefile contents, not just existence'))]
various
hgext: add largefiles extension...
r15168 entry[1].extend(verifyopt)
Mads Kiilerich
largefiles: introduce basic debugstate --large functionality...
r18144 entry = extensions.wrapcommand(commands.table, 'debugstate',
overrides.overridedebugstate)
debugstateopt = [('', 'large', None, _('display largefiles dirstate'))]
entry[1].extend(debugstateopt)
FUJIWARA Katsunori
largefiles: use "outgoinghooks" to avoid redundant outgoing check...
r21052 outgoing = lambda orgfunc, *arg, **kwargs: orgfunc(*arg, **kwargs)
entry = extensions.wrapcommand(commands.table, 'outgoing', outgoing)
various
hgext: add largefiles extension...
r15168 outgoingopt = [('', 'large', None, _('display outgoing largefiles'))]
entry[1].extend(outgoingopt)
FUJIWARA Katsunori
largefiles: use "outgoinghooks" to avoid redundant outgoing check...
r21052 cmdutil.outgoinghooks.add('largefiles', overrides.outgoinghook)
Matt Mackall
largefiles: fix over-long lines
r15170 entry = extensions.wrapcommand(commands.table, 'summary',
Na'Tosha Bard
largefiles: remove use of underscores that breaks coding convention
r16247 overrides.overridesummary)
various
hgext: add largefiles extension...
r15168 summaryopt = [('', 'large', None, _('display outgoing largefiles'))]
entry[1].extend(summaryopt)
FUJIWARA Katsunori
largefiles: use "summaryremotehooks" to avoid redundant outgoing check...
r21048 cmdutil.summaryremotehooks.add('largefiles', overrides.summaryremotehook)
various
hgext: add largefiles extension...
r15168
Matt Mackall
largefiles: fix over-long lines
r15170 entry = extensions.wrapcommand(commands.table, 'pull',
Na'Tosha Bard
largefiles: remove use of underscores that breaks coding convention
r16247 overrides.overridepull)
Na'Tosha Bard
largefiles: add --all-largefiles flag to pull
r16692 pullopt = [('', 'all-largefiles', None,
Mads Kiilerich
largefiles: deprecate --all-largefiles for pull...
r18982 _('download all pulled versions of largefiles (DEPRECATED)')),
Mads Kiilerich
largefiles: introduce pull --lfrev option...
r18978 ('', 'lfrev', [],
_('download largefiles for these revisions'), _('REV'))]
Na'Tosha Bard
largefiles: add --all-largefiles flag to pull
r16692 entry[1].extend(pullopt)
Mads Kiilerich
largefiles: introduce pulled() revset expression for use in --lfrev...
r18979
Mads Kiilerich
largefiles: introduce push --lfrev to control which revisions are pushed...
r28878 entry = extensions.wrapcommand(commands.table, 'push',
overrides.overridepush)
pushopt = [('', 'lfrev', [],
_('upload largefiles for these revisions'), _('REV'))]
entry[1].extend(pushopt)
Martin von Zweigbergk
largefiles: remove unused assignments from wrapfunction()...
r34077 extensions.wrapfunction(exchange, 'pushoperation',
overrides.exchangepushoperation)
Mads Kiilerich
largefiles: introduce push --lfrev to control which revisions are pushed...
r28878
Na'Tosha Bard
largefiles: add --all-largefiles flag to clone (issue3188)
r16644 entry = extensions.wrapcommand(commands.table, 'clone',
overrides.overrideclone)
cloneopt = [('', 'all-largefiles', None,
_('download all versions of all largefiles'))]
Matt Harbison
largefiles: delegate to the wrapped clone command...
r17601 entry[1].extend(cloneopt)
Martin von Zweigbergk
largefiles: remove unused assignments from wrapfunction()...
r34077 extensions.wrapfunction(hg, 'clone', overrides.hgclone)
Na'Tosha Bard
largefiles: add --all-largefiles flag to clone (issue3188)
r16644
Na'Tosha Bard
largefiles: fix cat for largefiles (issue3352)...
r16439 entry = extensions.wrapcommand(commands.table, 'cat',
overrides.overridecat)
Martin von Zweigbergk
largefiles: remove unused assignments from wrapfunction()...
r34077 extensions.wrapfunction(merge, '_checkunknownfile',
overrides.overridecheckunknownfile)
extensions.wrapfunction(merge, 'calculateupdates',
overrides.overridecalculateupdates)
extensions.wrapfunction(merge, 'recordupdates',
overrides.mergerecordupdates)
extensions.wrapfunction(merge, 'update', overrides.mergeupdate)
extensions.wrapfunction(filemerge, '_filemerge',
overrides.overridefilemerge)
extensions.wrapfunction(cmdutil, 'copy', overrides.overridecopy)
various
hgext: add largefiles extension...
r15168
Matt Harbison
largefiles: notice dirty large files in a subrepo...
r16516 # Summary calls dirty on the subrepos
Martin von Zweigbergk
largefiles: remove unused assignments from wrapfunction()...
r34077 extensions.wrapfunction(subrepo.hgsubrepo, 'dirty', overrides.overridedirty)
Matt Harbison
largefiles: notice dirty large files in a subrepo...
r16516
Martin von Zweigbergk
largefiles: remove unused assignments from wrapfunction()...
r34077 extensions.wrapfunction(cmdutil, 'revert', overrides.overriderevert)
various
hgext: add largefiles extension...
r15168
Matt Harbison
largefiles: allow the archiving of largefiles to be disabled...
r25811 extensions.wrapcommand(commands.table, 'archive',
overrides.overridearchivecmd)
Na'Tosha Bard
largefiles: remove use of underscores that breaks coding convention
r16247 extensions.wrapfunction(archival, 'archive', overrides.overridearchive)
Mads Kiilerich
largefiles: import whole modules instead of importing parts of them...
r21084 extensions.wrapfunction(subrepo.hgsubrepo, 'archive',
overrides.hgsubrepoarchive)
Martin von Zweigbergk
largefiles: remove unused assignments from wrapfunction()...
r34077 extensions.wrapfunction(webcommands, 'archive', overrides.hgwebarchive)
Greg Ward
largefiles: drop more unnecessary compatibility checks
r15349 extensions.wrapfunction(cmdutil, 'bailifchanged',
Na'Tosha Bard
largefiles: remove use of underscores that breaks coding convention
r16247 overrides.overridebailifchanged)
various
hgext: add largefiles extension...
r15168
Matt Harbison
largefiles: report the missing file count after a commit that does nothing...
r27944 extensions.wrapfunction(cmdutil, 'postcommitstatus',
overrides.postcommitstatus)
FUJIWARA Katsunori
largefiles: update largefiles even if transplant is aborted by conflict...
r22289 extensions.wrapfunction(scmutil, 'marktouched',
overrides.scmutilmarktouched)
Boris Feld
largefiles: add support for 'largefiles://' url scheme...
r35580 extensions.wrapfunction(url, 'open',
overrides.openlargefile)
various
hgext: add largefiles extension...
r15168 # create the new wireproto commands ...
Gregory Szorc
wireproto: rename wireproto to wireprotov1server (API)...
r37803 wireprotov1server.wireprotocommand('putlfile', 'sha', permission='push')(
Gregory Szorc
wireproto: declare permissions requirements in @wireprotocommand (API)...
r36818 proto.putlfile)
Gregory Szorc
wireproto: rename wireproto to wireprotov1server (API)...
r37803 wireprotov1server.wireprotocommand('getlfile', 'sha', permission='pull')(
Gregory Szorc
wireproto: declare permissions requirements in @wireprotocommand (API)...
r36818 proto.getlfile)
Gregory Szorc
wireproto: rename wireproto to wireprotov1server (API)...
r37803 wireprotov1server.wireprotocommand('statlfile', 'sha', permission='pull')(
Gregory Szorc
wireproto: declare permissions requirements in @wireprotocommand (API)...
r36818 proto.statlfile)
Gregory Szorc
wireproto: rename wireproto to wireprotov1server (API)...
r37803 wireprotov1server.wireprotocommand('lheads', '', permission='pull')(
wireprotov1server.heads)
various
hgext: add largefiles extension...
r15168
# ... and wrap some existing ones
Gregory Szorc
wireproto: rename wireproto to wireprotov1server (API)...
r37803 extensions.wrapfunction(wireprotov1server.commands['heads'], 'func',
proto.heads)
Gregory Szorc
wireproto: separate commands tables for version 1 and 2 commands...
r37311 # TODO also wrap wireproto.commandsv2 once heads is implemented there.
various
hgext: add largefiles extension...
r15168
Martin Geisler
largefiles: hide .hglf/ prefix for largefiles in hgweb...
r16449 extensions.wrapfunction(webcommands, 'decodepath', overrides.decodepath)
Gregory Szorc
wireproto: rename wireproto to wireprotov1server (API)...
r37803 extensions.wrapfunction(wireprotov1server, '_capabilities',
proto._capabilities)
various
hgext: add largefiles extension...
r15168
# can't do this in reposetup because it needs to have happened before
# wirerepo.__init__ is called
Gregory Szorc
sshpeer: rename sshpeer class to sshv1peer (API)...
r35995 proto.ssholdcallstream = sshpeer.sshv1peer._callstream
Peter Arrenbrecht
peer: introduce real peer classes...
r17192 proto.httpoldcallstream = httppeer.httppeer._callstream
Gregory Szorc
sshpeer: rename sshpeer class to sshv1peer (API)...
r35995 sshpeer.sshv1peer._callstream = proto.sshrepocallstream
Peter Arrenbrecht
peer: introduce real peer classes...
r17192 httppeer.httppeer._callstream = proto.httprepocallstream
various
hgext: add largefiles extension...
r15168
# override some extensions' stuff as well
for name, module in extensions.extensions():
if name == 'purge':
extensions.wrapcommand(getattr(module, 'cmdtable'), 'purge',
Na'Tosha Bard
largefiles: remove use of underscores that breaks coding convention
r16247 overrides.overridepurge)
various
hgext: add largefiles extension...
r15168 if name == 'rebase':
extensions.wrapcommand(getattr(module, 'cmdtable'), 'rebase',
Na'Tosha Bard
largefiles: remove use of underscores that breaks coding convention
r16247 overrides.overriderebase)
FUJIWARA Katsunori
largefiles: wrap "rebase.rebase" for functions using it directly...
r23182 extensions.wrapfunction(module, 'rebase',
overrides.overriderebase)
Na'Tosha Bard
largefiles: fix bad bug where transplanting a changeset with a largefile will result in an old largefile being comitted later on
r15383 if name == 'transplant':
extensions.wrapcommand(getattr(module, 'cmdtable'), 'transplant',
Na'Tosha Bard
largefiles: remove use of underscores that breaks coding convention
r16247 overrides.overridetransplant)