comparison mercurial/commands.py @ 20594:ba619c50a355 stable

resolve: use "other" changeset from merge state (issue4163) We can use the "other" data from the recorded merge state instead of inferring what the other could be from working copy parent. This will allow resolve to fulfil its duty even when the second parent have been dropped. Most direct benefit is fixing a regression in backout.
author Pierre-Yves David <pierre-yves.david@fb.com>
date Tue, 25 Feb 2014 18:45:01 -0800
parents 7f865a94691e
children 710c2755e66a 2d183dd54384
comparison
equal deleted inserted replaced
20593:3678707e4017 20594:ba619c50a355
4959 ms.mark(f, "r") 4959 ms.mark(f, "r")
4960 elif unmark: 4960 elif unmark:
4961 ms.mark(f, "u") 4961 ms.mark(f, "u")
4962 else: 4962 else:
4963 wctx = repo[None] 4963 wctx = repo[None]
4964 mctx = wctx.parents()[-1]
4965 4964
4966 # backup pre-resolve (merge uses .orig for its own purposes) 4965 # backup pre-resolve (merge uses .orig for its own purposes)
4967 a = repo.wjoin(f) 4966 a = repo.wjoin(f)
4968 util.copyfile(a, a + ".resolve") 4967 util.copyfile(a, a + ".resolve")
4969 4968
4970 try: 4969 try:
4971 # resolve file 4970 # resolve file
4972 ui.setconfig('ui', 'forcemerge', opts.get('tool', '')) 4971 ui.setconfig('ui', 'forcemerge', opts.get('tool', ''))
4973 if ms.resolve(f, wctx, mctx): 4972 if ms.resolve(f, wctx):
4974 ret = 1 4973 ret = 1
4975 finally: 4974 finally:
4976 ui.setconfig('ui', 'forcemerge', '') 4975 ui.setconfig('ui', 'forcemerge', '')
4977 ms.commit() 4976 ms.commit()
4978 4977