comparison mercurial/merge.py @ 45630:588068d5f2da

merge: check for conflicting actions irrespective of length of bids We should for whether bids contain a combination of actions which conflict with each other. Since right now we only have couple of such combination, and combinations also consist of two actions, we were checking for them only when length of bids is 2. Let's check that irrespective of the length of bids.
author Pulkit Goyal <7895pulkit@gmail.com>
date Fri, 02 Oct 2020 18:40:39 +0530
parents e8078af6af30
children ebc14a2ad23d
comparison
equal deleted inserted replaced
45629:292962570857 45630:588068d5f2da
1221 # Let's fall back to conflicting ACTION_CHANGED_DELETED and let user 1221 # Let's fall back to conflicting ACTION_CHANGED_DELETED and let user
1222 # do the right thing 1222 # do the right thing
1223 if ( 1223 if (
1224 mergestatemod.ACTION_CHANGED_DELETED in bids 1224 mergestatemod.ACTION_CHANGED_DELETED in bids
1225 and mergestatemod.ACTION_KEEP_NEW in bids 1225 and mergestatemod.ACTION_KEEP_NEW in bids
1226 and len(bids) == 2
1227 ): 1226 ):
1228 repo.ui.note(_(b" %s: picking 'changed/deleted' action\n") % f) 1227 repo.ui.note(_(b" %s: picking 'changed/deleted' action\n") % f)
1229 mresult.addfile( 1228 mresult.addfile(
1230 f, *bids[mergestatemod.ACTION_CHANGED_DELETED][0] 1229 f, *bids[mergestatemod.ACTION_CHANGED_DELETED][0]
1231 ) 1230 )
1241 # side. Let's fallback and rely on a conflicting action to let user 1240 # side. Let's fallback and rely on a conflicting action to let user
1242 # do the right thing 1241 # do the right thing
1243 if ( 1242 if (
1244 mergestatemod.ACTION_DELETED_CHANGED in bids 1243 mergestatemod.ACTION_DELETED_CHANGED in bids
1245 and mergestatemod.ACTION_GET in bids 1244 and mergestatemod.ACTION_GET in bids
1246 and len(bids) == 2
1247 ): 1245 ):
1248 repo.ui.note(_(b" %s: picking 'delete/changed' action\n") % f) 1246 repo.ui.note(_(b" %s: picking 'delete/changed' action\n") % f)
1249 mresult.addfile( 1247 mresult.addfile(
1250 f, *bids[mergestatemod.ACTION_DELETED_CHANGED][0] 1248 f, *bids[mergestatemod.ACTION_DELETED_CHANGED][0]
1251 ) 1249 )