simplemerge: rewrite flag merging loop as expression
I feel binary operations are more readable.
--- a/mercurial/simplemerge.py Tue Jun 02 21:40:49 2020 +0900
+++ b/mercurial/simplemerge.py Tue Jun 02 21:44:57 2020 +0900
@@ -517,11 +517,9 @@
otherflags = set(pycompat.iterbytestr(otherctx.flags()))
if is_not_null(basectx) and localflags != otherflags:
baseflags = set(pycompat.iterbytestr(basectx.flags()))
- flags = localflags & otherflags
- for f in localflags.symmetric_difference(otherflags):
- if f not in baseflags:
- flags.add(f)
- flags = b''.join(sorted(flags))
+ commonflags = localflags & otherflags
+ addedflags = (localflags ^ otherflags) - baseflags
+ flags = b''.join(sorted(commonflags | addedflags))
if not opts.get(b'print'):
localctx.write(mergedtext, flags)