379 |
379 |
380 self._dirty = True |
380 self._dirty = True |
381 oldp2 = self._pl[1] |
381 oldp2 = self._pl[1] |
382 if self._origpl is None: |
382 if self._origpl is None: |
383 self._origpl = self._pl |
383 self._origpl = self._pl |
384 self._map.setparents(p1, p2) |
|
385 copies = {} |
|
386 nullid = self._nodeconstants.nullid |
384 nullid = self._nodeconstants.nullid |
387 if oldp2 != nullid and p2 == nullid: |
385 # True if we need to fold p2 related state back to a linear case |
388 candidatefiles = self._map.non_normal_or_other_parent_paths() |
386 fold_p2 = oldp2 != nullid and p2 == nullid |
389 |
387 return self._map.setparents(p1, p2, fold_p2=fold_p2) |
390 for f in candidatefiles: |
|
391 s = self._map.get(f) |
|
392 if s is None: |
|
393 continue |
|
394 |
|
395 # Discard "merged" markers when moving away from a merge state |
|
396 if s.merged: |
|
397 source = self._map.copymap.get(f) |
|
398 if source: |
|
399 copies[f] = source |
|
400 self._map.reset_state( |
|
401 f, |
|
402 wc_tracked=True, |
|
403 p1_tracked=True, |
|
404 possibly_dirty=True, |
|
405 ) |
|
406 # Also fix up otherparent markers |
|
407 elif s.from_p2: |
|
408 source = self._map.copymap.get(f) |
|
409 if source: |
|
410 copies[f] = source |
|
411 self._map.reset_state( |
|
412 f, |
|
413 p1_tracked=False, |
|
414 wc_tracked=True, |
|
415 ) |
|
416 return copies |
|
417 |
388 |
418 def setbranch(self, branch): |
389 def setbranch(self, branch): |
419 self.__class__._branch.set(self, encoding.fromlocal(branch)) |
390 self.__class__._branch.set(self, encoding.fromlocal(branch)) |
420 f = self._opener(b'branch', b'w', atomictemp=True, checkambig=True) |
391 f = self._opener(b'branch', b'w', atomictemp=True, checkambig=True) |
421 try: |
392 try: |