comparison hgext/absorb.py @ 44984:bfef35bb4ecb

absorb: preserve branch-closing changesets even if empty This makes the behavior consistent with 'hg commit', which allows to create otherwise empty changesets if they close the branch. A lost branch closure can inadvertently re-open a branch, so it should be preserved.
author Manuel Jacob <me@manueljacob.de>
date Mon, 01 Jun 2020 11:07:33 +0200
parents 1b757f385549
children 1ca0047fd7e1
comparison
equal deleted inserted replaced
44983:1b757f385549 44984:bfef35bb4ecb
887 if len(parents) != 1: 887 if len(parents) != 1:
888 return False 888 return False
889 pctx = parents[0] 889 pctx = parents[0]
890 if ctx.branch() != pctx.branch(): 890 if ctx.branch() != pctx.branch():
891 return False 891 return False
892 if ctx.extra().get(b'close'):
893 return False
892 # ctx changes more files (not a subset of memworkingcopy) 894 # ctx changes more files (not a subset of memworkingcopy)
893 if not set(ctx.files()).issubset(set(memworkingcopy)): 895 if not set(ctx.files()).issubset(set(memworkingcopy)):
894 return False 896 return False
895 for path, content in pycompat.iteritems(memworkingcopy): 897 for path, content in pycompat.iteritems(memworkingcopy):
896 if path not in pctx or path not in ctx: 898 if path not in pctx or path not in ctx: