Linux iad1-shared-b7-18 6.6.49-grsec-jammy+ #10 SMP Thu Sep 12 23:23:08 UTC 2024 x86_64
Apache
: 67.205.6.31 | : 216.73.216.47
Cant Read [ /etc/named.conf ]
8.2.29
fernandoquevedo
Terminal
AUTO ROOT
Adminer
Backdoor Destroyer
Linux Exploit
Lock Shell
Lock File
Create User
CREATE RDP
PHP Mailer
BACKCONNECT
UNLOCK SHELL
HASH IDENTIFIER
README
+ Create Folder
+ Create File
/
usr /
lib /
python3 /
dist-packages /
mercurial /
[ HOME SHELL ]
Name
Size
Permission
Action
__pycache__
[ DIR ]
drwxr-xr-x
cext
[ DIR ]
drwxr-xr-x
cffi
[ DIR ]
drwxr-xr-x
defaultrc
[ DIR ]
drwxr-xr-x
dirstateutils
[ DIR ]
drwxr-xr-x
helptext
[ DIR ]
drwxr-xr-x
hgweb
[ DIR ]
drwxr-xr-x
interfaces
[ DIR ]
drwxr-xr-x
locale
[ DIR ]
drwxr-xr-x
pure
[ DIR ]
drwxr-xr-x
revlogutils
[ DIR ]
drwxr-xr-x
templates
[ DIR ]
drwxr-xr-x
testing
[ DIR ]
drwxr-xr-x
thirdparty
[ DIR ]
drwxr-xr-x
upgrade_utils
[ DIR ]
drwxr-xr-x
utils
[ DIR ]
drwxr-xr-x
__init__.py
416
B
-rw-r--r--
__modulepolicy__.py
61
B
-rw-r--r--
__version__.py
60
B
-rw-r--r--
ancestor.py
12.51
KB
-rw-r--r--
archival.py
11.59
KB
-rw-r--r--
bookmarks.py
34.74
KB
-rw-r--r--
branchmap.py
31.58
KB
-rw-r--r--
bundle2.py
86.74
KB
-rw-r--r--
bundlecaches.py
13.6
KB
-rw-r--r--
bundlerepo.py
23.29
KB
-rw-r--r--
cacheutil.py
827
B
-rw-r--r--
changegroup.py
65.72
KB
-rw-r--r--
changelog.py
19.72
KB
-rw-r--r--
chgserver.py
26.25
KB
-rw-r--r--
cmdutil.py
131.98
KB
-rw-r--r--
color.py
17.93
KB
-rw-r--r--
commands.py
257.93
KB
-rw-r--r--
commandserver.py
24.59
KB
-rw-r--r--
commit.py
18.52
KB
-rw-r--r--
config.py
8.59
KB
-rw-r--r--
configitems.py
46.49
KB
-rw-r--r--
context.py
100.53
KB
-rw-r--r--
copies.py
46.01
KB
-rw-r--r--
crecord.py
70.99
KB
-rw-r--r--
dagop.py
39.57
KB
-rw-r--r--
dagparser.py
15.13
KB
-rw-r--r--
debugcommands.py
154.84
KB
-rw-r--r--
destutil.py
17.07
KB
-rw-r--r--
diffhelper.py
2.32
KB
-rw-r--r--
diffutil.py
4.52
KB
-rw-r--r--
dirstate.py
51.01
KB
-rw-r--r--
dirstateguard.py
3.09
KB
-rw-r--r--
dirstatemap.py
23.77
KB
-rw-r--r--
discovery.py
22
KB
-rw-r--r--
dispatch.py
46.19
KB
-rw-r--r--
dummycert.pem
2.19
KB
-rw-r--r--
encoding.py
22.89
KB
-rw-r--r--
error.py
17.88
KB
-rw-r--r--
exchange.py
94.65
KB
-rw-r--r--
extensions.py
30.6
KB
-rw-r--r--
exthelper.py
11.83
KB
-rw-r--r--
fancyopts.py
11.3
KB
-rw-r--r--
filelog.py
8.58
KB
-rw-r--r--
filemerge.py
39.67
KB
-rw-r--r--
fileset.py
18.66
KB
-rw-r--r--
filesetlang.py
10.34
KB
-rw-r--r--
formatter.py
26.34
KB
-rw-r--r--
graphmod.py
16.76
KB
-rw-r--r--
grep.py
7.26
KB
-rw-r--r--
hbisect.py
10.89
KB
-rw-r--r--
help.py
36.74
KB
-rw-r--r--
hg.py
51.95
KB
-rw-r--r--
hook.py
11.53
KB
-rw-r--r--
httpconnection.py
4.27
KB
-rw-r--r--
httppeer.py
20.71
KB
-rw-r--r--
i18n.py
4.05
KB
-rw-r--r--
keepalive.py
27.1
KB
-rw-r--r--
linelog.py
14.94
KB
-rw-r--r--
localrepo.py
140.97
KB
-rw-r--r--
lock.py
11.89
KB
-rw-r--r--
logcmdutil.py
42.53
KB
-rw-r--r--
logexchange.py
4.98
KB
-rw-r--r--
loggingutil.py
3.93
KB
-rw-r--r--
lsprof.py
4.25
KB
-rw-r--r--
lsprofcalltree.py
2.74
KB
-rw-r--r--
mail.py
17.09
KB
-rw-r--r--
manifest.py
75.45
KB
-rw-r--r--
match.py
52.06
KB
-rw-r--r--
mdiff.py
17.37
KB
-rw-r--r--
merge.py
90.09
KB
-rw-r--r--
mergestate.py
31.37
KB
-rw-r--r--
mergeutil.py
502
B
-rw-r--r--
metadata.py
32.33
KB
-rw-r--r--
minifileset.py
3.54
KB
-rw-r--r--
minirst.py
29.13
KB
-rw-r--r--
namespaces.py
8.19
KB
-rw-r--r--
narrowspec.py
11.57
KB
-rw-r--r--
node.py
2.07
KB
-rw-r--r--
obsolete.py
36.76
KB
-rw-r--r--
obsutil.py
35.84
KB
-rw-r--r--
parser.py
25.68
KB
-rw-r--r--
patch.py
102
KB
-rw-r--r--
pathutil.py
12.21
KB
-rw-r--r--
phases.py
32.54
KB
-rw-r--r--
policy.py
4.74
KB
-rw-r--r--
posix.py
23.05
KB
-rw-r--r--
profiling.py
8.64
KB
-rw-r--r--
progress.py
10.92
KB
-rw-r--r--
pushkey.py
1.67
KB
-rw-r--r--
pvec.py
6.01
KB
-rw-r--r--
pycompat.py
16.33
KB
-rw-r--r--
rcutil.py
3.57
KB
-rw-r--r--
registrar.py
17.78
KB
-rw-r--r--
repair.py
18.46
KB
-rw-r--r--
repocache.py
4.49
KB
-rw-r--r--
repoview.py
16.89
KB
-rw-r--r--
requirements.py
4.64
KB
-rw-r--r--
revlog.py
117.08
KB
-rw-r--r--
revset.py
87.27
KB
-rw-r--r--
revsetlang.py
28.47
KB
-rw-r--r--
rewriteutil.py
8.47
KB
-rw-r--r--
scmposix.py
2.57
KB
-rw-r--r--
scmutil.py
75.72
KB
-rw-r--r--
scmwindows.py
3.37
KB
-rw-r--r--
server.py
7.05
KB
-rw-r--r--
setdiscovery.py
18
KB
-rw-r--r--
shelve.py
38.04
KB
-rw-r--r--
similar.py
3.97
KB
-rw-r--r--
simplemerge.py
16.86
KB
-rw-r--r--
smartset.py
33.65
KB
-rw-r--r--
sparse.py
26.37
KB
-rw-r--r--
sshpeer.py
22.56
KB
-rw-r--r--
sslutil.py
35.54
KB
-rw-r--r--
stack.py
762
B
-rw-r--r--
state.py
11.99
KB
-rw-r--r--
statichttprepo.py
7.92
KB
-rw-r--r--
statprof.py
32.16
KB
-rw-r--r--
store.py
25.27
KB
-rw-r--r--
streamclone.py
30.73
KB
-rw-r--r--
strip.py
8.72
KB
-rw-r--r--
subrepo.py
70.89
KB
-rw-r--r--
subrepoutil.py
17.42
KB
-rw-r--r--
tagmerge.py
11.29
KB
-rw-r--r--
tags.py
29.67
KB
-rw-r--r--
templatefilters.py
15.11
KB
-rw-r--r--
templatefuncs.py
30.14
KB
-rw-r--r--
templatekw.py
34.12
KB
-rw-r--r--
templater.py
37.7
KB
-rw-r--r--
templateutil.py
35.66
KB
-rw-r--r--
transaction.py
25.97
KB
-rw-r--r--
treediscovery.py
5.92
KB
-rw-r--r--
txnutil.py
1.02
KB
-rw-r--r--
ui.py
80.23
KB
-rw-r--r--
unionrepo.py
9.72
KB
-rw-r--r--
upgrade.py
14.59
KB
-rw-r--r--
url.py
24.56
KB
-rw-r--r--
urllibcompat.py
5.94
KB
-rw-r--r--
util.py
95.18
KB
-rw-r--r--
verify.py
21.8
KB
-rw-r--r--
vfs.py
24.93
KB
-rw-r--r--
win32.py
22.04
KB
-rw-r--r--
windows.py
21.77
KB
-rw-r--r--
wireprotoframing.py
64.95
KB
-rw-r--r--
wireprotoserver.py
17.38
KB
-rw-r--r--
wireprototypes.py
13.07
KB
-rw-r--r--
wireprotov1peer.py
21.51
KB
-rw-r--r--
wireprotov1server.py
26.33
KB
-rw-r--r--
worker.py
15.47
KB
-rw-r--r--
zstd.cpython-310-x86_64-linux-...
570.78
KB
-rw-r--r--
Delete
Unzip
Zip
${this.title}
Close
Code Editor : upgrade.py
# upgrade.py - functions for in place upgrade of Mercurial repository # # Copyright (c) 2016-present, Gregory Szorc # # This software may be used and distributed according to the terms of the # GNU General Public License version 2 or any later version. from __future__ import absolute_import from .i18n import _ from . import ( error, hg, localrepo, lock as lockmod, pycompat, requirements as requirementsmod, scmutil, ) from .upgrade_utils import ( actions as upgrade_actions, engine as upgrade_engine, ) from .utils import ( stringutil, ) allformatvariant = upgrade_actions.allformatvariant def upgraderepo( ui, repo, run=False, optimize=None, backup=True, manifest=None, changelog=None, filelogs=None, ): """Upgrade a repository in place.""" if optimize is None: optimize = set() repo = repo.unfiltered() specified_revlogs = {} if changelog is not None: specified_revlogs[upgrade_engine.UPGRADE_CHANGELOG] = changelog if manifest is not None: specified_revlogs[upgrade_engine.UPGRADE_MANIFEST] = manifest if filelogs is not None: specified_revlogs[upgrade_engine.UPGRADE_FILELOGS] = filelogs # Ensure the repository can be upgraded. upgrade_actions.check_source_requirements(repo) default_options = localrepo.defaultcreateopts(repo.ui) newreqs = localrepo.newreporequirements(repo.ui, default_options) newreqs.update(upgrade_actions.preservedrequirements(repo)) upgrade_actions.check_requirements_changes(repo, newreqs) # Find and validate all improvements that can be made. alloptimizations = upgrade_actions.findoptimizations(repo) # Apply and Validate arguments. optimizations = [] for o in alloptimizations: if o.name in optimize: optimizations.append(o) optimize.discard(o.name) if optimize: # anything left is unknown raise error.Abort( _(b'unknown optimization action requested: %s') % b', '.join(sorted(optimize)), hint=_(b'run without arguments to see valid optimizations'), ) format_upgrades = upgrade_actions.find_format_upgrades(repo) up_actions = upgrade_actions.determine_upgrade_actions( repo, format_upgrades, optimizations, repo.requirements, newreqs ) removed_actions = upgrade_actions.find_format_downgrades(repo) # check if we need to touch revlog and if so, which ones touched_revlogs = set() overwrite_msg = _(b'warning: ignoring %14s, as upgrade is changing: %s\n') select_msg = _(b'note: selecting %s for processing to change: %s\n') msg_issued = 0 FL = upgrade_engine.UPGRADE_FILELOGS MN = upgrade_engine.UPGRADE_MANIFEST CL = upgrade_engine.UPGRADE_CHANGELOG if optimizations: if any(specified_revlogs.values()): # we have some limitation on revlogs to be recloned for rl, enabled in specified_revlogs.items(): if enabled: touched_revlogs.add(rl) else: touched_revlogs = set(upgrade_engine.UPGRADE_ALL_REVLOGS) for rl, enabled in specified_revlogs.items(): if not enabled: touched_revlogs.discard(rl) if repo.shared(): unsafe_actions = set() unsafe_actions.update(up_actions) unsafe_actions.update(removed_actions) unsafe_actions.update(optimizations) unsafe_actions = [ a for a in unsafe_actions if not a.compatible_with_share ] unsafe_actions.sort(key=lambda a: a.name) if unsafe_actions: m = _(b'cannot use these actions on a share repository: %s') h = _(b'upgrade the main repository directly') actions = b', '.join(a.name for a in unsafe_actions) m %= actions raise error.Abort(m, hint=h) for action in sorted(up_actions + removed_actions, key=lambda a: a.name): # optimisation does not "requires anything, they just needs it. if action.type != upgrade_actions.FORMAT_VARIANT: continue if action.touches_filelogs and FL not in touched_revlogs: if FL in specified_revlogs: if not specified_revlogs[FL]: msg = overwrite_msg % (b'--no-filelogs', action.name) ui.warn(msg) msg_issued = 2 else: msg = select_msg % (b'all-filelogs', action.name) ui.status(msg) if not ui.quiet: msg_issued = 1 touched_revlogs.add(FL) if action.touches_manifests and MN not in touched_revlogs: if MN in specified_revlogs: if not specified_revlogs[MN]: msg = overwrite_msg % (b'--no-manifest', action.name) ui.warn(msg) msg_issued = 2 else: msg = select_msg % (b'all-manifestlogs', action.name) ui.status(msg) if not ui.quiet: msg_issued = 1 touched_revlogs.add(MN) if action.touches_changelog and CL not in touched_revlogs: if CL in specified_revlogs: if not specified_revlogs[CL]: msg = overwrite_msg % (b'--no-changelog', action.name) ui.warn(msg) msg_issued = True else: msg = select_msg % (b'changelog', action.name) ui.status(msg) if not ui.quiet: msg_issued = 1 touched_revlogs.add(CL) if msg_issued >= 2: ui.warn((b"\n")) elif msg_issued >= 1: ui.status((b"\n")) upgrade_op = upgrade_actions.UpgradeOperation( ui, newreqs, repo.requirements, up_actions, removed_actions, touched_revlogs, backup, ) if not run: fromconfig = [] onlydefault = [] for d in format_upgrades: if d.fromconfig(repo): fromconfig.append(d) elif d.default: onlydefault.append(d) if fromconfig or onlydefault: if fromconfig: ui.status( _( b'repository lacks features recommended by ' b'current config options:\n\n' ) ) for i in fromconfig: ui.status(b'%s\n %s\n\n' % (i.name, i.description)) if onlydefault: ui.status( _( b'repository lacks features used by the default ' b'config options:\n\n' ) ) for i in onlydefault: ui.status(b'%s\n %s\n\n' % (i.name, i.description)) ui.status(b'\n') else: ui.status(_(b'(no format upgrades found in existing repository)\n')) ui.status( _( b'performing an upgrade with "--run" will make the following ' b'changes:\n\n' ) ) upgrade_op.print_requirements() upgrade_op.print_optimisations() upgrade_op.print_upgrade_actions() upgrade_op.print_affected_revlogs() if upgrade_op.unused_optimizations: ui.status( _( b'additional optimizations are available by specifying ' b'"--optimize <name>":\n\n' ) ) upgrade_op.print_unused_optimizations() return if not (upgrade_op.upgrade_actions or upgrade_op.removed_actions): ui.status(_(b'nothing to do\n')) return # Else we're in the run=true case. ui.write(_(b'upgrade will perform the following actions:\n\n')) upgrade_op.print_requirements() upgrade_op.print_optimisations() upgrade_op.print_upgrade_actions() upgrade_op.print_affected_revlogs() ui.status(_(b'beginning upgrade...\n')) with repo.wlock(), repo.lock(): ui.status(_(b'repository locked and read-only\n')) # Our strategy for upgrading the repository is to create a new, # temporary repository, write data to it, then do a swap of the # data. There are less heavyweight ways to do this, but it is easier # to create a new repo object than to instantiate all the components # (like the store) separately. tmppath = pycompat.mkdtemp(prefix=b'upgrade.', dir=repo.path) backuppath = None try: ui.status( _( b'creating temporary repository to stage upgraded ' b'data: %s\n' ) % tmppath ) # clone ui without using ui.copy because repo.ui is protected repoui = repo.ui.__class__(repo.ui) dstrepo = hg.repository(repoui, path=tmppath, create=True) with dstrepo.wlock(), dstrepo.lock(): backuppath = upgrade_engine.upgrade( ui, repo, dstrepo, upgrade_op ) finally: ui.status(_(b'removing temporary repository %s\n') % tmppath) repo.vfs.rmtree(tmppath, forcibly=True) if backuppath and not ui.quiet: ui.warn( _(b'copy of old repository backed up at %s\n') % backuppath ) ui.warn( _( b'the old repository will not be deleted; remove ' b'it to free up disk space once the upgraded ' b'repository is verified\n' ) ) upgrade_op.print_post_op_messages() def upgrade_share_to_safe( ui, hgvfs, storevfs, current_requirements, mismatch_config, mismatch_warn, ): """Upgrades a share to use share-safe mechanism""" wlock = None store_requirements = localrepo._readrequires(storevfs, False) original_crequirements = current_requirements.copy() # after upgrade, store requires will be shared, so lets find # the requirements which are not present in store and # write them to share's .hg/requires diffrequires = current_requirements - store_requirements # add share-safe requirement as it will mark the share as share-safe diffrequires.add(requirementsmod.SHARESAFE_REQUIREMENT) current_requirements.add(requirementsmod.SHARESAFE_REQUIREMENT) # in `allow` case, we don't try to upgrade, we just respect the source # state, update requirements and continue if mismatch_config == b'allow': return try: wlock = lockmod.trylock(ui, hgvfs, b'wlock', 0, 0) # some process might change the requirement in between, re-read # and update current_requirements locked_requirements = localrepo._readrequires(hgvfs, True) if locked_requirements != original_crequirements: removed = current_requirements - locked_requirements # update current_requirements in place because it's passed # as reference current_requirements -= removed current_requirements |= locked_requirements diffrequires = current_requirements - store_requirements # add share-safe requirement as it will mark the share as share-safe diffrequires.add(requirementsmod.SHARESAFE_REQUIREMENT) current_requirements.add(requirementsmod.SHARESAFE_REQUIREMENT) scmutil.writerequires(hgvfs, diffrequires) ui.warn(_(b'repository upgraded to use share-safe mode\n')) except error.LockError as e: hint = _( b"see `hg help config.format.use-share-safe` for more information" ) if mismatch_config == b'upgrade-abort': raise error.Abort( _(b'failed to upgrade share, got error: %s') % stringutil.forcebytestr(e.strerror), hint=hint, ) elif mismatch_warn: ui.warn( _(b'failed to upgrade share, got error: %s\n') % stringutil.forcebytestr(e.strerror), hint=hint, ) finally: if wlock: wlock.release() def downgrade_share_to_non_safe( ui, hgvfs, sharedvfs, current_requirements, mismatch_config, mismatch_warn, ): """Downgrades a share which use share-safe to not use it""" wlock = None source_requirements = localrepo._readrequires(sharedvfs, True) original_crequirements = current_requirements.copy() # we cannot be 100% sure on which requirements were present in store when # the source supported share-safe. However, we do know that working # directory requirements were not there. Hence we remove them source_requirements -= requirementsmod.WORKING_DIR_REQUIREMENTS current_requirements |= source_requirements current_requirements.remove(requirementsmod.SHARESAFE_REQUIREMENT) if mismatch_config == b'allow': return try: wlock = lockmod.trylock(ui, hgvfs, b'wlock', 0, 0) # some process might change the requirement in between, re-read # and update current_requirements locked_requirements = localrepo._readrequires(hgvfs, True) if locked_requirements != original_crequirements: removed = current_requirements - locked_requirements # update current_requirements in place because it's passed # as reference current_requirements -= removed current_requirements |= locked_requirements current_requirements |= source_requirements current_requirements -= set(requirementsmod.SHARESAFE_REQUIREMENT) scmutil.writerequires(hgvfs, current_requirements) ui.warn(_(b'repository downgraded to not use share-safe mode\n')) except error.LockError as e: hint = _( b"see `hg help config.format.use-share-safe` for more information" ) # If upgrade-abort is set, abort when upgrade fails, else let the # process continue as `upgrade-allow` is set if mismatch_config == b'downgrade-abort': raise error.Abort( _(b'failed to downgrade share, got error: %s') % stringutil.forcebytestr(e.strerror), hint=hint, ) elif mismatch_warn: ui.warn( _(b'failed to downgrade share, got error: %s\n') % stringutil.forcebytestr(e.strerror), hint=hint, ) finally: if wlock: wlock.release()
Close