comparison hgext/absorb.py @ 44983:1b757f385549

absorb: preserve branch-changing changesets even if empty This makes the behavior consistent with 'hg commit', which allows to create otherwise empty changesets if the branch changes compared to the parent. A branch change can denote important information, so it should be preserved.
author Manuel Jacob <me@manueljacob.de>
date Mon, 01 Jun 2020 10:33:00 +0200
parents 9d2b2df2c2ba
children bfef35bb4ecb
comparison
equal deleted inserted replaced
44982:bacf6c7ef01b 44983:1b757f385549
885 if not pctx: 885 if not pctx:
886 parents = ctx.parents() 886 parents = ctx.parents()
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():
891 return False
890 # ctx changes more files (not a subset of memworkingcopy) 892 # ctx changes more files (not a subset of memworkingcopy)
891 if not set(ctx.files()).issubset(set(memworkingcopy)): 893 if not set(ctx.files()).issubset(set(memworkingcopy)):
892 return False 894 return False
893 for path, content in pycompat.iteritems(memworkingcopy): 895 for path, content in pycompat.iteritems(memworkingcopy):
894 if path not in pctx or path not in ctx: 896 if path not in pctx or path not in ctx: