hgext/largefiles/proto.py
changeset 17192 1ac628cd7113
parent 17127 9e1616307c4c
child 18298 3598c585e464
equal deleted inserted replaced
17191:5884812686f7 17192:1ac628cd7113
     4 # GNU General Public License version 2 or any later version.
     4 # GNU General Public License version 2 or any later version.
     5 
     5 
     6 import os
     6 import os
     7 import urllib2
     7 import urllib2
     8 
     8 
     9 from mercurial import error, httprepo, util, wireproto
     9 from mercurial import error, httppeer, util, wireproto
    10 from mercurial.wireproto import batchable, future
    10 from mercurial.wireproto import batchable, future
    11 from mercurial.i18n import _
    11 from mercurial.i18n import _
    12 
    12 
    13 import lfutil
    13 import lfutil
    14 
    14 
    80     class lfileswirerepository(repo.__class__):
    80     class lfileswirerepository(repo.__class__):
    81         def putlfile(self, sha, fd):
    81         def putlfile(self, sha, fd):
    82             # unfortunately, httprepository._callpush tries to convert its
    82             # unfortunately, httprepository._callpush tries to convert its
    83             # input file-like into a bundle before sending it, so we can't use
    83             # input file-like into a bundle before sending it, so we can't use
    84             # it ...
    84             # it ...
    85             if issubclass(self.__class__, httprepo.httprepository):
    85             if issubclass(self.__class__, httppeer.httppeer):
    86                 res = None
    86                 res = None
    87                 try:
    87                 try:
    88                     res = self._call('putlfile', data=fd, sha=sha,
    88                     res = self._call('putlfile', data=fd, sha=sha,
    89                         headers={'content-type':'application/mercurial-0.1'})
    89                         headers={'content-type':'application/mercurial-0.1'})
    90                     d, output = res.split('\n', 1)
    90                     d, output = res.split('\n', 1)