##// END OF EJS Templates
merge: pass mergeresult in checkpassconflicts() instead of actions (API)...
Pulkit Goyal -
r45841:31c454a5 default
parent child Browse files
Show More
@@ -382,7 +382,7 b' def _filesindirs(repo, manifest, dirs):'
382 break
382 break
383
383
384
384
385 def checkpathconflicts(repo, wctx, mctx, actions):
385 def checkpathconflicts(repo, wctx, mctx, mresult):
386 """
386 """
387 Check if any actions introduce path conflicts in the repository, updating
387 Check if any actions introduce path conflicts in the repository, updating
388 actions to record or handle the path conflict accordingly.
388 actions to record or handle the path conflict accordingly.
@@ -407,7 +407,7 b' def checkpathconflicts(repo, wctx, mctx,'
407 # The set of files deleted by all the actions.
407 # The set of files deleted by all the actions.
408 deletedfiles = set()
408 deletedfiles = set()
409
409
410 for f, (m, args, msg) in actions.items():
410 for f, (m, args, msg) in mresult.actions.items():
411 if m in (
411 if m in (
412 mergestatemod.ACTION_CREATED,
412 mergestatemod.ACTION_CREATED,
413 mergestatemod.ACTION_DELETED_CHANGED,
413 mergestatemod.ACTION_DELETED_CHANGED,
@@ -444,7 +444,7 b' def checkpathconflicts(repo, wctx, mctx,'
444 # A file is in a directory which aliases a local file.
444 # A file is in a directory which aliases a local file.
445 # We will need to rename the local file.
445 # We will need to rename the local file.
446 localconflicts.add(p)
446 localconflicts.add(p)
447 if p in actions and actions[p][0] in (
447 if p in mresult.actions and mresult.actions[p][0] in (
448 mergestatemod.ACTION_CREATED,
448 mergestatemod.ACTION_CREATED,
449 mergestatemod.ACTION_DELETED_CHANGED,
449 mergestatemod.ACTION_DELETED_CHANGED,
450 mergestatemod.ACTION_MERGE,
450 mergestatemod.ACTION_MERGE,
@@ -459,14 +459,16 b' def checkpathconflicts(repo, wctx, mctx,'
459 for p in localconflicts:
459 for p in localconflicts:
460 if p not in deletedfiles:
460 if p not in deletedfiles:
461 ctxname = bytes(wctx).rstrip(b'+')
461 ctxname = bytes(wctx).rstrip(b'+')
462 pnew = util.safename(p, ctxname, wctx, set(actions.keys()))
462 pnew = util.safename(p, ctxname, wctx, set(mresult.actions.keys()))
463 porig = wctx[p].copysource() or p
463 porig = wctx[p].copysource() or p
464 actions[pnew] = (
464 mresult.addfile(
465 pnew,
465 mergestatemod.ACTION_PATH_CONFLICT_RESOLVE,
466 mergestatemod.ACTION_PATH_CONFLICT_RESOLVE,
466 (p, porig),
467 (p, porig),
467 b'local path conflict',
468 b'local path conflict',
468 )
469 )
469 actions[p] = (
470 mresult.addfile(
471 p,
470 mergestatemod.ACTION_PATH_CONFLICT,
472 mergestatemod.ACTION_PATH_CONFLICT,
471 (pnew, b'l'),
473 (pnew, b'l'),
472 b'path conflict',
474 b'path conflict',
@@ -477,23 +479,27 b' def checkpathconflicts(repo, wctx, mctx,'
477 ctxname = bytes(mctx).rstrip(b'+')
479 ctxname = bytes(mctx).rstrip(b'+')
478 for f, p in _filesindirs(repo, mf, remoteconflicts):
480 for f, p in _filesindirs(repo, mf, remoteconflicts):
479 if f not in deletedfiles:
481 if f not in deletedfiles:
480 m, args, msg = actions[p]
482 m, args, msg = mresult.actions[p]
481 pnew = util.safename(p, ctxname, wctx, set(actions.keys()))
483 pnew = util.safename(
484 p, ctxname, wctx, set(mresult.actions.keys())
485 )
482 if m in (
486 if m in (
483 mergestatemod.ACTION_DELETED_CHANGED,
487 mergestatemod.ACTION_DELETED_CHANGED,
484 mergestatemod.ACTION_MERGE,
488 mergestatemod.ACTION_MERGE,
485 ):
489 ):
486 # Action was merge, just update target.
490 # Action was merge, just update target.
487 actions[pnew] = (m, args, msg)
491 mresult.addfile(pnew, m, args, msg)
488 else:
492 else:
489 # Action was create, change to renamed get action.
493 # Action was create, change to renamed get action.
490 fl = args[0]
494 fl = args[0]
491 actions[pnew] = (
495 mresult.addfile(
496 pnew,
492 mergestatemod.ACTION_LOCAL_DIR_RENAME_GET,
497 mergestatemod.ACTION_LOCAL_DIR_RENAME_GET,
493 (p, fl),
498 (p, fl),
494 b'remote path conflict',
499 b'remote path conflict',
495 )
500 )
496 actions[p] = (
501 mresult.addfile(
502 p,
497 mergestatemod.ACTION_PATH_CONFLICT,
503 mergestatemod.ACTION_PATH_CONFLICT,
498 (pnew, mergestatemod.ACTION_REMOVE),
504 (pnew, mergestatemod.ACTION_REMOVE),
499 b'path conflict',
505 b'path conflict',
@@ -939,7 +945,7 b' def manifestmerge('
939
945
940 if repo.ui.configbool(b'experimental', b'merge.checkpathconflicts'):
946 if repo.ui.configbool(b'experimental', b'merge.checkpathconflicts'):
941 # If we are merging, look for path conflicts.
947 # If we are merging, look for path conflicts.
942 checkpathconflicts(repo, wctx, p2, mresult.actions)
948 checkpathconflicts(repo, wctx, p2, mresult)
943
949
944 narrowmatch = repo.narrowmatch()
950 narrowmatch = repo.narrowmatch()
945 if not narrowmatch.always():
951 if not narrowmatch.always():
General Comments 0
You need to be logged in to leave comments. Login now