\x89\x50\x4E\x47\x0D\x0A\x1A\x0A PNG  \x89\x50\x4E\x47\x0D\x0A\x1A\x0A  13\c@@sddlmZddlZddlZddlZddlZddlmZddl m Z m Z ddl m Z ejZejZejZejZejZejZejZdZddZd Zd Zd Zd ZdS( i(tabsolute_importN(tcommon(tpycompattutili(t blobstorec@sO||rtSjjjdds5tStjjjdsQtSjs^tSyqjdkrdt j|Sjj drt j|fdStSWnyt j k rJ}x$|jD]\}}||j|:ss0 %s N(tTruetrepotuit configbooltFalseRt safehasattrtsvfst dispatchpatht_processbatchrequestt startswitht_processbasictransfert hgwebcommont ErrorResponsetheaderst statusmessagetcodeRtbytestrtstatust setbodybytes(torigR R tresR tetktv((R R R sB/usr/lib64/python2.7/site-packages/hgext/lfs/wireprotolfsserver.pythandlewsgirequest"s, !cC@s6tj|d||_d|jd<|jddS(Ntmessagestext/plain; charset=utf-8s Content-Typet(RRRRR(R!RR&((sB/usr/lib64/python2.7/site-packages/hgext/lfs/wireprotolfsserver.pyt _sethttperrorGs cC@smtjtj}|jd}d}|jrA||j7}n|d|j7}|jd||fdS(s=Write information about the current exception to wsgi.errors.s wsgi.errorsR't/s4Exception happened while processing request '%s': %sN(Rtsysbytest tracebackt format_exctrawenvtapppathRtwrite(R ttbterrorlogturi((sB/usr/lib64/python2.7/site-packages/hgext/lfs/wireprotolfsserver.pyt _logexceptionLs   c C@sx|jdkr t|ttS|jddkrDt|ttS|jddkrht|ttStj|j j }d|j ddgkrt|t dtS|j d}|dkrt|t d |tS|j j}gt||j d g||D] }|^q}idd 6|d 6}tjt|_d|jd<|jtjtj|tS(sHandle a request for the Batch API, which is the gateway to granting file access. https://github.com/git-lfs/git-lfs/blob/master/docs/api/batch.md tPOSTs Content-Typesapplication/vnd.git-lfs+jsontAccepttbasict transferss0Only the basic LFS transfer handler is supportedt operationtuploadtdownloads&Unsupported LFS transfer operation: %stobjectsttransfer(R9R:(tmethodR(tHTTP_METHOD_NOT_ALLOWEDR RtHTTP_UNSUPPORTED_MEDIA_TYPEtHTTP_NOT_ACCEPTABLEtjsontloadstbodyfhtreadtgettHTTP_BAD_REQUESTRRt_batchresponseobjectsRRtHTTP_OKRRRRtdumps( RR R!tlfsreqR8t localstoretpR;trsp((sB/usr/lib64/python2.7/site-packages/hgext/lfs/wireprotolfsserver.pyRYs:          c #@sx|D]}|jdjd}i|d6|jdd6}t}t}y5|j|}|r|dkr|j|nWnatk r} | jtjkrt idd6| j pdd6|d <|Vqnt}nX|d krH|sid d6d d6|d <|VqqY|sYid d6dd6|d <|VqqYn|rY|Vqnt j j t j dd} fd} iidjj|fd6| jdd6| d6d|6|d<|VqWdS(s4Yield one dictionary of attributes for the Batch API response for each object in the list. req: The parsedrequest for the Batch API request objects: The list of objects in the Batch API object request list action: 'upload' or 'download' store: The local blob store for servicing requeststoidtasciitsizeR9iRsInternal Server ServerR&terrorR:isThe object does not existisThe object is corrupttminutesi c@sBidd6}jjdd}|jdr>||d( RR R!R R=RNRKtexistedR((sB/usr/lib64/python2.7/site-packages/hgext/lfs/wireprotolfsserver.pyRsB                (t __future__RRbR_RAR+tmercurial.hgwebRRt mercurialRRR'RRHRtRFRrR>R@R?R%tNoneR(R3RRGR(((sB/usr/lib64/python2.7/site-packages/hgext/lfs/wireprotolfsserver.pyts(            %  E u