comparison mercurial/merge.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 3678707e4017
children abd448767465 b96cb15ec9e0
comparison
equal deleted inserted replaced
20593:3678707e4017 20594:ba619c50a355
184 def files(self): 184 def files(self):
185 return self._state.keys() 185 return self._state.keys()
186 def mark(self, dfile, state): 186 def mark(self, dfile, state):
187 self._state[dfile][0] = state 187 self._state[dfile][0] = state
188 self._dirty = True 188 self._dirty = True
189 def resolve(self, dfile, wctx, octx): 189 def resolve(self, dfile, wctx):
190 if self[dfile] == 'r': 190 if self[dfile] == 'r':
191 return 0 191 return 0
192 stateentry = self._state[dfile] 192 stateentry = self._state[dfile]
193 state, hash, lfile, afile, anode, ofile, onode, flags = stateentry 193 state, hash, lfile, afile, anode, ofile, onode, flags = stateentry
194 octx = self._repo[self._other]
194 fcd = wctx[dfile] 195 fcd = wctx[dfile]
195 fco = octx[ofile] 196 fco = octx[ofile]
196 fca = self._repo.filectx(afile, fileid=anode) 197 fca = self._repo.filectx(afile, fileid=anode)
197 # "premerge" x flags 198 # "premerge" x flags
198 flo = fco.flags() 199 flo = fco.flags()
639 if fd == '.hgsubstate': # subrepo states need updating 640 if fd == '.hgsubstate': # subrepo states need updating
640 subrepo.submerge(repo, wctx, mctx, wctx.ancestor(mctx), 641 subrepo.submerge(repo, wctx, mctx, wctx.ancestor(mctx),
641 overwrite) 642 overwrite)
642 continue 643 continue
643 audit(fd) 644 audit(fd)
644 r = ms.resolve(fd, wctx, mctx) 645 r = ms.resolve(fd, wctx)
645 if r is not None and r > 0: 646 if r is not None and r > 0:
646 unresolved += 1 647 unresolved += 1
647 else: 648 else:
648 if r is None: 649 if r is None:
649 updated += 1 650 updated += 1