diff --git a/mercurial/dirstate.py b/mercurial/dirstate.py --- a/mercurial/dirstate.py +++ b/mercurial/dirstate.py @@ -734,7 +734,10 @@ class dirstate(object): # (see `merged_removed` and `from_p2_removed`) if entry.merged_removed or entry.from_p2_removed: source = self._map.copymap.get(f) - self._addpath(f, from_p2=True) + if entry.merged_removed: + self._addpath(f, merged=True) + else: + self._addpath(f, from_p2=True) self._map.copymap.pop(f, None) if source is not None: self.copy(source, f) diff --git a/tests/test-merge-remove.t b/tests/test-merge-remove.t --- a/tests/test-merge-remove.t +++ b/tests/test-merge-remove.t @@ -55,8 +55,8 @@ Re-adding foo1 and bar: adding foo1 $ hg debugstate --no-dates - n 0 -2 unset bar - n 0 -2 unset foo1 + m 0 -2 unset bar + m 0 -2 unset foo1 copy: foo -> foo1 $ hg st -qC @@ -74,8 +74,8 @@ Reverting foo1 and bar: reverting foo1 $ hg debugstate --no-dates - n 0 -2 unset bar - n 0 -2 unset foo1 + m 0 -2 unset bar + m 0 -2 unset foo1 copy: foo -> foo1 $ hg st -qC