equal
deleted
inserted
replaced
454 def _bytes_to_set(b): |
454 def _bytes_to_set(b): |
455 """turns a multiple bytes (usually flags) into a set of individual byte""" |
455 """turns a multiple bytes (usually flags) into a set of individual byte""" |
456 return set(b[x : x + 1] for x in range(len(b))) |
456 return set(b[x : x + 1] for x in range(len(b))) |
457 |
457 |
458 |
458 |
459 def is_null(ctx): |
459 def is_not_null(ctx): |
460 if not util.safehasattr(ctx, "node"): |
460 if not util.safehasattr(ctx, "node"): |
461 return False |
461 return False |
462 return ctx.node() != nodemod.nullid |
462 return ctx.node() != nodemod.nullid |
463 |
463 |
464 |
464 |
518 |
518 |
519 # merge flags if necessary |
519 # merge flags if necessary |
520 flags = localctx.flags() |
520 flags = localctx.flags() |
521 localflags = _bytes_to_set(flags) |
521 localflags = _bytes_to_set(flags) |
522 otherflags = _bytes_to_set(otherctx.flags()) |
522 otherflags = _bytes_to_set(otherctx.flags()) |
523 if is_null(basectx) and localflags != otherflags: |
523 if is_not_null(basectx) and localflags != otherflags: |
524 baseflags = _bytes_to_set(basectx.flags()) |
524 baseflags = _bytes_to_set(basectx.flags()) |
525 flags = localflags & otherflags |
525 flags = localflags & otherflags |
526 for f in localflags.symmetric_difference(otherflags): |
526 for f in localflags.symmetric_difference(otherflags): |
527 if f not in baseflags: |
527 if f not in baseflags: |
528 flags.add(f) |
528 flags.add(f) |