##// END OF EJS Templates
mergeresult: introduce getfile() and use it where required...
Pulkit Goyal -
r45904:4c6004af default
parent child Browse files
Show More
@@ -571,8 +571,8 b' def overridecalculateupdates('
571 571
572 572 for lfile in sorted(lfiles):
573 573 standin = lfutil.standin(lfile)
574 (lm, largs, lmsg) = mresult.actions.get(lfile, (None, None, None))
575 (sm, sargs, smsg) = mresult.actions.get(standin, (None, None, None))
574 (lm, largs, lmsg) = mresult.getfile(lfile, (None, None, None))
575 (sm, sargs, smsg) = mresult.getfile(standin, (None, None, None))
576 576 if sm in (b'g', b'dc') and lm != b'r':
577 577 if sm == b'dc':
578 578 f1, f2, fa, move, anc = sargs
@@ -454,7 +454,8 b' def checkpathconflicts(repo, wctx, mctx,'
454 454 # A file is in a directory which aliases a local file.
455 455 # We will need to rename the local file.
456 456 localconflicts.add(p)
457 if p in mresult.actions and mresult.actions[p][0] in (
457 pd = mresult.getfile(p)
458 if pd and pd[0] in (
458 459 mergestatemod.ACTION_CREATED,
459 460 mergestatemod.ACTION_DELETED_CHANGED,
460 461 mergestatemod.ACTION_MERGE,
@@ -489,7 +490,7 b' def checkpathconflicts(repo, wctx, mctx,'
489 490 ctxname = bytes(mctx).rstrip(b'+')
490 491 for f, p in _filesindirs(repo, mf, remoteconflicts):
491 492 if f not in deletedfiles:
492 m, args, msg = mresult.actions[p]
493 m, args, msg = mresult.getfile(p)
493 494 pnew = util.safename(
494 495 p, ctxname, wctx, set(mresult.actions.keys())
495 496 )
@@ -612,6 +613,14 b' class mergeresult(object):'
612 613 self._filemapping[filename] = (action, data, message)
613 614 self._actionmapping[action][filename] = (data, message)
614 615
616 def getfile(self, filename, default_return=None):
617 """ returns (action, args, msg) about this file
618
619 returns default_return if the file is not present """
620 if filename in self._filemapping:
621 return self._filemapping[filename]
622 return default_return
623
615 624 def removefile(self, filename):
616 625 """ removes a file from the mergeresult object as the file might
617 626 not merging anymore """
@@ -1960,9 +1969,10 b' def update('
1960 1969 # Prompt and create actions. Most of this is in the resolve phase
1961 1970 # already, but we can't handle .hgsubstate in filemerge or
1962 1971 # subrepoutil.submerge yet so we have to keep prompting for it.
1963 if b'.hgsubstate' in mresult.actions:
1972 vals = mresult.getfile(b'.hgsubstate')
1973 if vals:
1964 1974 f = b'.hgsubstate'
1965 m, args, msg = mresult.actions[f]
1975 m, args, msg = vals
1966 1976 prompts = filemerge.partextras(labels)
1967 1977 prompts[b'f'] = f
1968 1978 if m == mergestatemod.ACTION_CHANGED_DELETED:
General Comments 0
You need to be logged in to leave comments. Login now