Yuya Nishihara <yuya@tcha.org> [Mon, 19 Mar 2018 20:32:06 +0900] rev 37328
obsutil: make obsfateprinter() less dependent on templater
joinfmt() is defined as 'lambda x: scmutil.formatchangeid(repo[x])' in
showsuccsandmarkers().
Function arguments are reordered so they look more normal.
Yuya Nishihara <yuya@tcha.org> [Sat, 17 Mar 2018 22:06:31 +0900] rev 37327
templater: abstract away from joinfmt
Future patches will add a wrapper for a list of template mappings, which
will implement a custom join() something like {join(mappings % template)}.
The original join() function is broken down as follows:
if hasattr(joinset, 'joinfmt'):
# hybrid.join() where values must be a list or a dict
joinitems((joinfmt(x) for x in values), sep)
elif isinstance(joinset, templateutil.wrapped):
# mappable.join()
show()
else:
# a plain list, a generator, or a byte string; joinfmt was identity()
joinset = templateutil.unwrapvalue(context, joinset)
joinitems(pycompat.maybebytestr(joinset), joiner)
Yuya Nishihara <yuya@tcha.org> [Tue, 20 Mar 2018 23:16:28 +0900] rev 37326
templater: micro-optimize join() with empty separator
Yuya Nishihara <yuya@tcha.org> [Sat, 17 Mar 2018 21:42:27 +0900] rev 37325
templater: factor out generator of join()-ed items
Prepares for defining join() behavior per wrapped types and getting rid
of the public joinfmt attribute.
Yuya Nishihara <yuya@tcha.org> [Sun, 18 Mar 2018 23:24:50 +0900] rev 37324
templater: pass context to itermaps() for future extension
Unlike show() and tovalue(), a base mapping isn't passed to itermaps()
since it is the function to generate a partial mapping.
Yuya Nishihara <yuya@tcha.org> [Sat, 17 Mar 2018 21:21:50 +0900] rev 37323
templater: define interface for objects which act as iterator of mappings
Yuya Nishihara <yuya@tcha.org> [Wed, 04 Apr 2018 23:26:49 +0900] rev 37322
stringutil: drop escapedata() in favor of escapestr()
They are quite similar. Let's choose one that uses standard Python escape.
Gregory Szorc <gregory.szorc@gmail.com> [Fri, 30 Mar 2018 18:57:13 -0700] rev 37321
peer: make ui an attribute
With abc interfaces, instance attributes could not satisfy
@abc.abstractproperty requirements because interface conformance
was tested at type creation time. When we created the abc
peer interfaces, we had to make "ui" a @property to satisfy
abc.
Now that peer interfaces are using zope.interface and there is no
import time validation (but there are tests validating instances
conform to the interface), we can go back to using regular object
attributes.
Differential Revision: https://phab.mercurial-scm.org/D3069