hgext/remotefilelog/remotefilelogserver.py
changeset 40507 e2a1584e9e3f
parent 40503 3b90087623fd
child 40508 354acd0dc637
equal deleted inserted replaced
40506:10c10da14c5d 40507:e2a1584e9e3f
     8 
     8 
     9 import errno
     9 import errno
    10 import os
    10 import os
    11 import stat
    11 import stat
    12 import time
    12 import time
       
    13 import zlib
    13 
    14 
    14 from mercurial.i18n import _
    15 from mercurial.i18n import _
    15 from mercurial.node import bin, hex, nullid
    16 from mercurial.node import bin, hex, nullid
    16 from mercurial import (
    17 from mercurial import (
    17     changegroup,
    18     changegroup,
    26     wireprotoserver,
    27     wireprotoserver,
    27     wireprototypes,
    28     wireprototypes,
    28     wireprotov1server,
    29     wireprotov1server,
    29 )
    30 )
    30 from .  import (
    31 from .  import (
    31     lz4wrapper,
       
    32     shallowrepo,
    32     shallowrepo,
    33     shallowutil,
    33     shallowutil,
    34 )
    34 )
    35 
    35 
    36 _sshv1server = wireprotoserver.sshv1protocolhandler
    36 _sshv1server = wireprotoserver.sshv1protocolhandler
   228         if filectx.node() == nullid:
   228         if filectx.node() == nullid:
   229             repo.changelog = changelog.changelog(repo.svfs)
   229             repo.changelog = changelog.changelog(repo.svfs)
   230             filectx = repo.filectx(path, fileid=node)
   230             filectx = repo.filectx(path, fileid=node)
   231 
   231 
   232         text = createfileblob(filectx)
   232         text = createfileblob(filectx)
   233         text = lz4wrapper.lzcompresshc(text)
   233         # TODO configurable compression engines
       
   234         text = zlib.compress(text)
   234 
   235 
   235         # everything should be user & group read/writable
   236         # everything should be user & group read/writable
   236         oldumask = os.umask(0o002)
   237         oldumask = os.umask(0o002)
   237         try:
   238         try:
   238             dirname = os.path.dirname(filecachepath)
   239             dirname = os.path.dirname(filecachepath)