Changeset 70e309ffda36…
Parent 3f4083dafa13…
by Benjamin Pollack <benjamin@fogcreek.com>
Changes to 2 files · Browse files at 70e309ffda36 Showing diff from parent 3f4083dafa13 Diff from another changeset...
@@ -178,7 +178,7 @@ path = ''
remote = repo
else:
- remote = hg.peer(repo, {}, path)
+ remote = hg.repository(hg.remoteui(ui, {}), path, False)
# The path could be a scheme so use Mercurial's normal functionality
# to resolve the scheme to a repository and use its path
|
@@ -83,8 +83,7 @@ # in this case: send the data straight through
else:
try:
- ret, output = self._callpush("putbfile", fd, sha=sha,
- headers={'content-type':'application/mercurial-0.1'})
+ ret, output = self._callpush("putbfile", fd, sha=sha)
if ret == "":
raise error.ResponseError(_('putbfile failed:'),
output)
@@ -114,17 +113,30 @@ # way, consider it missing
return 2
- @wireproto.batchable
- def heads(self):
- f = wireproto.future()
- yield {}, f
- d = f.value
- if d[:len(_heads_prefix)] == _heads_prefix:
- d = d[len(_heads_prefix):]
- try:
- yield wireproto.decodelist(d[:-1])
- except ValueError:
- self._abort(error.ResponseError(_("unexpected response:"), d))
+ try:
+ @wireproto.batchable
+ def heads(self):
+ f = wireproto.future()
+ yield {}, f
+ d = f.value
+ if d[:len(_heads_prefix)] == _heads_prefix:
+ d = d[len(_heads_prefix):]
+ try:
+ yield wireproto.decodelist(d[:-1])
+ except ValueError:
+ self._abort(error.ResponseError(_("unexpected response:"), d))
+ except AttributeError:
+ # Mercurial < 1.9 has no @batchable; define a normal wirerepo heads
+ # command
+ def heads(self):
+ d = self._call('heads')
+ if d[:len(_heads_prefix)] == _heads_prefix:
+ d = d[len(_heads_prefix):]
+ try:
+ return wireproto.decodelist(d[:-1])
+ except ValueError:
+ self._abort(error.ResponseError(_("unexpected response:"), d))
+
repo.__class__ = kbfileswirerepository
# wrap dispatch to check for and remove the kbfiles argument so commands with
|
Loading...