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