Mercurial > evolve
diff hgext3rd/serverminitopic.py @ 4814:48b30ff742cb
python3: use format-source to run byteify-strings in .py files
Using the format-source extension smooth out the pain of merging after
auto-formatting.
This change makes all of the Evolve test suite pass under python3 and has
added benefit of being 100% automated using mercurial's `byteify-strings`
script version 1.0 (revision 11498aa91c036c6d70f7ac5ee5af2664a84a1130).
How to benefit from the help of format-source is explained in the README.
author | Raphaël Gomès <rgomes@octobus.net> |
---|---|
date | Tue, 06 Aug 2019 15:06:38 +0200 |
parents | 079dbf36e884 |
children | 51d0f2355215 |
line wrap: on
line diff
--- a/hgext3rd/serverminitopic.py Tue Aug 06 15:06:27 2019 +0200 +++ b/hgext3rd/serverminitopic.py Tue Aug 06 15:06:38 2019 +0200 @@ -33,7 +33,7 @@ configtable = {} configitem = registrar.configitem(configtable) - configitem('experimental', 'server-mini-topic', + configitem(b'experimental', b'server-mini-topic', default=False, ) @@ -44,7 +44,7 @@ """ enabled = getattr(repo, '_hasminitopic', None) if enabled is None: - enabled = (repo.ui.configbool('experimental', 'server-mini-topic') + enabled = (repo.ui.configbool(b'experimental', b'server-mini-topic') and not repo.publishing()) repo._hasminitopic = enabled return enabled @@ -54,10 +54,10 @@ def topicbranch(orig, self): branch = orig(self) if hasminitopic(self._repo) and self.phase(): - topic = self._changeset.extra.get('topic') + topic = self._changeset.extra.get(b'topic') if topic is not None: topic = encoding.tolocal(topic) - branch = '%s:%s' % (branch, topic) + branch = b'%s:%s' % (branch, topic) return branch ### avoid caching topic data in rev-branch-cache @@ -120,7 +120,7 @@ if revs: s = hashlib.sha1() for rev in revs: - s.update('%d;' % rev) + s.update(b'%d;' % rev) key = s.digest() return key @@ -138,8 +138,8 @@ branchmap.branchcache = previous _publiconly = set([ - 'base', - 'immutable', + b'base', + b'immutable', ]) def mighttopic(repo): @@ -216,7 +216,7 @@ def wireprotocaps(orig, repo, proto): caps = orig(repo, proto) if hasminitopic(repo): - caps.append('topics') + caps.append(b'topics') return caps # wrap the necessary bit