##// END OF EJS Templates
py3: fix infinitepush extension tests...
Mark Thomas -
r40288:090e5f39 default
parent child Browse files
Show More
@@ -255,6 +255,9 b' test-import-unknown.t'
255 test-import.t
255 test-import.t
256 test-imports-checker.t
256 test-imports-checker.t
257 test-incoming-outgoing.t
257 test-incoming-outgoing.t
258 test-infinitepush-bundlestore.t
259 test-infinitepush-ci.t
260 test-infinitepush.t
258 test-inherit-mode.t
261 test-inherit-mode.t
259 test-init.t
262 test-init.t
260 test-issue1089.t
263 test-issue1089.t
@@ -357,8 +357,7 b' def listkeyspatterns(self, namespace, pa'
357 if not self.capable('pushkey'):
357 if not self.capable('pushkey'):
358 yield {}, None
358 yield {}, None
359 f = wireprotov1peer.future()
359 f = wireprotov1peer.future()
360 self.ui.debug('preparing listkeys for "%s" with pattern "%s"\n' %
360 self.ui.debug('preparing listkeys for "%s"\n' % namespace)
361 (namespace, patterns))
362 yield {
361 yield {
363 'namespace': encoding.fromlocal(namespace),
362 'namespace': encoding.fromlocal(namespace),
364 'patterns': wireprototypes.encodelist(patterns)
363 'patterns': wireprototypes.encodelist(patterns)
@@ -696,8 +695,8 b' def _findcommonincoming(orig, *args, **k'
696 return common, True, remoteheads
695 return common, True, remoteheads
697
696
698 def _push(orig, ui, repo, dest=None, *args, **opts):
697 def _push(orig, ui, repo, dest=None, *args, **opts):
699
698 opts = pycompat.byteskwargs(opts)
700 bookmark = opts.get(r'bookmark')
699 bookmark = opts.get('bookmark')
701 # we only support pushing one infinitepush bookmark at once
700 # we only support pushing one infinitepush bookmark at once
702 if len(bookmark) == 1:
701 if len(bookmark) == 1:
703 bookmark = bookmark[0]
702 bookmark = bookmark[0]
@@ -718,7 +717,7 b' def _push(orig, ui, repo, dest=None, *ar'
718 if scratchpush:
717 if scratchpush:
719 # this is an infinitepush, we don't want the bookmark to be applied
718 # this is an infinitepush, we don't want the bookmark to be applied
720 # rather that should be stored in the bundlestore
719 # rather that should be stored in the bundlestore
721 opts[r'bookmark'] = []
720 opts['bookmark'] = []
722 ui.setconfig(experimental, configscratchpush, True)
721 ui.setconfig(experimental, configscratchpush, True)
723 oldphasemove = extensions.wrapfunction(exchange,
722 oldphasemove = extensions.wrapfunction(exchange,
724 '_localphasemove',
723 '_localphasemove',
@@ -732,7 +731,7 b' def _push(orig, ui, repo, dest=None, *ar'
732 # Remote scratch bookmarks will be deleted because remotenames doesn't
731 # Remote scratch bookmarks will be deleted because remotenames doesn't
733 # know about them. Let's save it before push and restore after
732 # know about them. Let's save it before push and restore after
734 remotescratchbookmarks = _readscratchremotebookmarks(ui, repo, destpath)
733 remotescratchbookmarks = _readscratchremotebookmarks(ui, repo, destpath)
735 result = orig(ui, repo, dest, *args, **opts)
734 result = orig(ui, repo, dest, *args, **pycompat.strkwargs(opts))
736 if common.isremotebooksenabled(ui):
735 if common.isremotebooksenabled(ui):
737 if bookmark and scratchpush:
736 if bookmark and scratchpush:
738 other = hg.peer(repo, opts, destpath)
737 other = hg.peer(repo, opts, destpath)
@@ -899,7 +898,7 b' def storetobundlestore(orig, repo, op, u'
899 if part.type in ('pushkey', 'changegroup'):
898 if part.type in ('pushkey', 'changegroup'):
900 if op.reply is not None:
899 if op.reply is not None:
901 rpart = op.reply.newpart('reply:%s' % part.type)
900 rpart = op.reply.newpart('reply:%s' % part.type)
902 rpart.addparam('in-reply-to', str(part.id),
901 rpart.addparam('in-reply-to', b'%d' % part.id,
903 mandatory=False)
902 mandatory=False)
904 rpart.addparam('return', '1', mandatory=False)
903 rpart.addparam('return', '1', mandatory=False)
905
904
@@ -33,7 +33,7 b' def _makebundlefromraw(data):'
33 fd, bundlefile = pycompat.mkstemp()
33 fd, bundlefile = pycompat.mkstemp()
34 try: # guards bundlefile
34 try: # guards bundlefile
35 try: # guards fp
35 try: # guards fp
36 fp = os.fdopen(fd, 'wb')
36 fp = os.fdopen(fd, r'wb')
37 fp.write(data)
37 fp.write(data)
38 finally:
38 finally:
39 fp.close()
39 fp.close()
@@ -12,6 +12,7 b' import subprocess'
12 import tempfile
12 import tempfile
13
13
14 from mercurial import (
14 from mercurial import (
15 node,
15 pycompat,
16 pycompat,
16 )
17 )
17 from mercurial.utils import (
18 from mercurial.utils import (
@@ -80,7 +81,7 b' class filebundlestore(object):'
80 return os.path.join(self._dirpath(filename), filename)
81 return os.path.join(self._dirpath(filename), filename)
81
82
82 def write(self, data):
83 def write(self, data):
83 filename = hashlib.sha1(data).hexdigest()
84 filename = node.hex(hashlib.sha1(data).digest())
84 dirpath = self._dirpath(filename)
85 dirpath = self._dirpath(filename)
85
86
86 if not os.path.exists(dirpath):
87 if not os.path.exists(dirpath):
General Comments 0
You need to be logged in to leave comments. Login now