diff 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
line wrap: on
line diff
--- a/hgext/absorb.py	Mon Jun 22 15:19:35 2020 +0530
+++ b/hgext/absorb.py	Mon Jun 01 10:33:00 2020 +0200
@@ -887,6 +887,8 @@
             if len(parents) != 1:
                 return False
             pctx = parents[0]
+        if ctx.branch() != pctx.branch():
+            return False
         # ctx changes more files (not a subset of memworkingcopy)
         if not set(ctx.files()).issubset(set(memworkingcopy)):
             return False