0000004a
  /   ˆ{‹„„-i[D<†ªoZƒ›Ù«Ã527_‘I|¥‰ÓMdœv ©ƒ†ü+=ÃÂ     ‹      Õ•ßoÚ0ÇßûWx~è�þX©ã©#HC¥€(Ó4MÓäÄ†XMìÈq`ì¯ŸCÂ`UÙº©ÕÖ§»Ø_ßÝçìØäU0îÍ>NúèÝìfˆ&ïß=„ :=€`T'Í–Ða„ck³.Àjµj®:Mm0›BlÓärkdd›ÜrL�H9F�‰ãÎ"b¥M(.¾"=G ›K.Üºu\,e$òÒ·"…T¤Ú¬ks~JsÑ‚(+Z�a%"PEt9 NBBÍ×enïIó¸p nÒ•®¡ÄÆhÉ¹P>¶:Ã”Èt�rùd¤UaÂÔ]s!ç±ÄúøÓ 7þìt`ãr5%ÅFÌ}ü¦ç�.Ç~€éˆ¥‚ {Xsã4W˜YnQª¹œKÁŠo+ñ­üv8`Pi‘GFfVjµ“‚CÜG�t’gÌ±ž:‚Øì«*	ÿ]7XôS3&WÓþh¦UKxbWÝßî¦f„²(�FDÖÍ×HUücæÙåöÕ¹ˆ-¦5ÐƒÊ? œë„³ÏyˆpË„éÖÛ¯ô^iíVû¬áy�¶‡Ú�îék„þ#—ÂljïÞòÎ»­³ge(Ô�Ò+µáó¯ ¾°Â…2:?hvCO±5î½þX÷�^*N!–î·Æ´²ÏðÈ«êG�Àæé!P={ßÏEÍY       ˆÀ¿Ä524¾ÃÂ     ‹      Õ•QoÓ0Çß÷)Œxk¯iÇ¦mŽÑh*QÑµUW„BÈ‰ÝÆZbG¶ÓR>=N“Ò2­0ˆñùrùûî~—ÄGžE“þüýt€^ÏoFhúöÕhØG¸ð®×ˆæQýà´Ý	 cŒpê\q	°^¯Ûë^[›%Ìg�º<;ëŒL\›;Žé	©|ô‘T0îWDœt™ CÅÅg¤té¬äÂïÛXàb%a+Û‰’¢¬®(ÍEr‘k³9ï‚-ãZA ç@“�ÄšoªÄÁŸKâcmKgñ6WeJ\ŠV,“Kb§L‰Ì—Èš$Ä ­,ÄSwí¥\`Ä2âÃþä£×�K«Ý”0”±ñË~8¾š„¦c–ìaÍ�×\c:bÖ¡\s¹�‚ßÖâ[ùåxÀ¨ÖDÂ&FNjµ—‚G<DMtfæY_x‚Ôªj	ÿY7Xò]3¦×³ÁxguKxb_Ýo½2L§ÌåP$�Hœw6<uðç*¶ÅÕî5Õ¹L¦µÐƒÊ_@\èŒsyo„éÎ:¬ô^iÝN÷¬­àç—�3„žƒ‘+a¶�õTJu§ôZBø/ùGŸXéC‹o4{×#°ºA…Õ»8ŠåÏÎ7ÿ ëÒÿŠSŠ•ÿ­1­×¿ðÈsš‰@`;tÔÓî+0ŸŸlP       	ˆÀ¿Ä591¾ÃÂ O    	‹      Õ–ßOÛ0Çßù+<?ì­½H<±iÕ TÐiš¦	¹±ÛX$vd»ÍÊ_?§¦V+RAðt¾ä›»û8çÑ‡ä²7ú9<C_GçhøýËy¿‡pàÇ^ %þÅ~7ÎáÌÚò ªªnµ×Uz
£+Èl‘ïƒ±Z¤¶Ë,Ãd'ªŸ‘eœ2gQd…Í9éKÆÿ 5A fÖÆÝwŒÏEÊM=¶¼€‚J/HÅxpï‡GOüƒ0Ü¥ƒ&_4VlQ—¾TJy‰EÇËÌõP“ÈfhNs1•1¶ªÄ$Å�ÆDª¤�qNåmw*&ÑÜÆøW¿wùÛéÀfõ×$¢(Ó|ãÏ½xpr'˜hÁ# «5NsŠÉ95Š‰‰àl­øÚ‹¯ÅÝú€‰×$Ü¤Z”V(ù(‡ØFMUnJêX?9‚L·U^Âþ74}2ÃÓ«³Á(é_ù)auˆÇê¶ñ1RÍ¥E‰Ð<µî]ƒçs}”cSžÜ»¨)^‹if1A¨ƒV*ŸA<Q9ãºÍ¼Žö¾^oÛUþSÖn°{Ð	ÃNx„ÂÃãà ¡¬&o¥ªdÀ5ÄJ %s!9&Þnp¸ÀmDß^ ÌæÆ·&-ç½¢ˆz'lH–ã·²ù¢(UÅµ[Þn£þW^ÚíGóúÌÀäaøV~Ã30Œ¥Ö!,Í[)ó.2³qsj8„‡ñ;Übg|îÎ2L¼ÝÀ+÷QˆÝÜ)É&-çå{jÃk4¼–7ÊüÅö/pˆ;       ˆÀ¿Ä‚h ¾ÃÂ š    ‹      ¥’QOÛ0Çßù7?ðFŽ
¶pŒ ©D¥ÒV%Ó4M{pb7¶HâÈ>èÊ§ŸÓt‚I 	í)‰ýóÏ÷¿ÿ”/³âûj
·ÅÝV_oæ³Ø	â·³1/òqã<9� N˜!ê/·Ûm²=Kœ¯±X£¡¶9Ç@ÞV”(RLñaM7ZªøN–-f�Ò¿Àm Ý#«t<·¨ô–�«p2¹8ÅðXÆUÒ-6Îõ_Ð¸Fi8Ž’¨Åƒ——Ní†ë&ÿ«Ž†}™²Üß0¼zÁÉÀ“llÝ¥Œ\Ï·mÁW)C[¹.Dµì’ÚnÈ†Röc–-FÉ§—`¼Þ¤ì*K—Ë4gb![ÍQ¾ÍÜEæš‰¹­Svcµz¾á{ûü¾0™\‡ÊÛž¬ë^PŒ_G­\z³~Ž	ŒM�ˆúW7dõW3V×ëé¢Ègë±%jP¼T÷¡ÅÄJzÝäÖëŠœßrŒÒã®ýåŸO8Témmˆ	€x“üHð0÷3Çqñß°¹òàE    5   ˆl–ß=¿J
hŠm@Šãn\i¥1hß�þd�K8ÈØãtŒÆ ?Æƒe¶^ÅÄÃ Ò    #! /usr/bin/python3
#
# Copyright 2005-2007 by Intevation GmbH <intevation@intevation.de>
#
# Author(s):
# Thomas Arendsen Hein <thomas@intevation.de>
#
# This software may be used and distributed according to the terms of the
# GNU General Public License version 2 or any later version.

"""
hg-ssh - a wrapper for ssh access to a limited set of mercurial repos

To be used in ~/.ssh/authorized_keys with the "command" option, see sshd(8):
command="hg-ssh path/to/repo1 /path/to/repo2 ~/repo3 ~user/repo4" ssh-dss ...
(probably together with these other useful options:
 no-port-forwarding,no-X11-forwarding,no-agent-forwarding)

This allows pull/push over ssh from/to the repositories given as arguments.

If all your repositories are subdirectories of a common directory, you can
allow shorter paths with:
command="cd path/to/my/repositories && hg-ssh repo1 subdir/repo2"

You can use pattern matching of your normal shell, e.g.:
command="cd repos && hg-ssh user/thomas/* projects/{mercurial,foo}"

You can also add a --read-only flag to allow read-only access to a key, e.g.:
command="hg-ssh --read-only repos/*"
"""

import os
import re
import shlex
import sys

# enable importing on demand to reduce startup time
import hgdemandimport

hgdemandimport.enable()

from mercurial import (
    dispatch,
    pycompat,
    ui as uimod,
)


def main():
    # Prevent insertion/deletion of CRs
    dispatch.initstdio()

    cwd = os.getcwd()
    if os.name == 'nt':
        # os.getcwd() is inconsistent on the capitalization of the drive
        # letter, so adjust it. see https://bugs.python.org/issue40368
        if re.match('^[a-z]:', cwd):
            cwd = cwd[0:1].upper() + cwd[1:]

    readonly = False
    args = sys.argv[1:]
    while len(args):
        if args[0] == '--read-only':
            r