diff --git a/contrib/python3-whitelist b/contrib/python3-whitelist --- a/contrib/python3-whitelist +++ b/contrib/python3-whitelist @@ -255,6 +255,9 @@ test-import.t test-imports-checker.t test-incoming-outgoing.t +test-infinitepush-bundlestore.t +test-infinitepush-ci.t +test-infinitepush.t test-inherit-mode.t test-init.t test-issue1089.t diff --git a/hgext/infinitepush/__init__.py b/hgext/infinitepush/__init__.py --- a/hgext/infinitepush/__init__.py +++ b/hgext/infinitepush/__init__.py @@ -357,8 +357,7 @@ if not self.capable('pushkey'): yield {}, None f = wireprotov1peer.future() - self.ui.debug('preparing listkeys for "%s" with pattern "%s"\n' % - (namespace, patterns)) + self.ui.debug('preparing listkeys for "%s"\n' % namespace) yield { 'namespace': encoding.fromlocal(namespace), 'patterns': wireprototypes.encodelist(patterns) @@ -696,8 +695,8 @@ return common, True, remoteheads def _push(orig, ui, repo, dest=None, *args, **opts): - - bookmark = opts.get(r'bookmark') + opts = pycompat.byteskwargs(opts) + bookmark = opts.get('bookmark') # we only support pushing one infinitepush bookmark at once if len(bookmark) == 1: bookmark = bookmark[0] @@ -718,7 +717,7 @@ if scratchpush: # this is an infinitepush, we don't want the bookmark to be applied # rather that should be stored in the bundlestore - opts[r'bookmark'] = [] + opts['bookmark'] = [] ui.setconfig(experimental, configscratchpush, True) oldphasemove = extensions.wrapfunction(exchange, '_localphasemove', @@ -732,7 +731,7 @@ # Remote scratch bookmarks will be deleted because remotenames doesn't # know about them. Let's save it before push and restore after remotescratchbookmarks = _readscratchremotebookmarks(ui, repo, destpath) - result = orig(ui, repo, dest, *args, **opts) + result = orig(ui, repo, dest, *args, **pycompat.strkwargs(opts)) if common.isremotebooksenabled(ui): if bookmark and scratchpush: other = hg.peer(repo, opts, destpath) @@ -899,7 +898,7 @@ if part.type in ('pushkey', 'changegroup'): if op.reply is not None: rpart = op.reply.newpart('reply:%s' % part.type) - rpart.addparam('in-reply-to', str(part.id), + rpart.addparam('in-reply-to', b'%d' % part.id, mandatory=False) rpart.addparam('return', '1', mandatory=False) diff --git a/hgext/infinitepush/common.py b/hgext/infinitepush/common.py --- a/hgext/infinitepush/common.py +++ b/hgext/infinitepush/common.py @@ -33,7 +33,7 @@ fd, bundlefile = pycompat.mkstemp() try: # guards bundlefile try: # guards fp - fp = os.fdopen(fd, 'wb') + fp = os.fdopen(fd, r'wb') fp.write(data) finally: fp.close() diff --git a/hgext/infinitepush/store.py b/hgext/infinitepush/store.py --- a/hgext/infinitepush/store.py +++ b/hgext/infinitepush/store.py @@ -12,6 +12,7 @@ import tempfile from mercurial import ( + node, pycompat, ) from mercurial.utils import ( @@ -80,7 +81,7 @@ return os.path.join(self._dirpath(filename), filename) def write(self, data): - filename = hashlib.sha1(data).hexdigest() + filename = node.hex(hashlib.sha1(data).digest()) dirpath = self._dirpath(filename) if not os.path.exists(dirpath):