# HG changeset patch # User Matt Mackall # Date 1160606268 18000 # Node ID 69fe021cc23e5e74bafa4c73891980ab3d9089b8 # Parent 04fa31a43b93d936e22560880bc22c2f6861c745# Parent be8efb6e1cc653731f1827ecbcc24c81b5d8744d Merge with crew diff --git a/mercurial/context.py b/mercurial/context.py --- a/mercurial/context.py +++ b/mercurial/context.py @@ -367,7 +367,8 @@ class workingctx(changectx): man.set(f, util.is_exec(self._repo.wjoin(f), man.execf(f))) for f in deleted + removed: - del man[f] + if f in man: + del man[f] self._manifest = man diff --git a/tests/test-manifest-merging b/tests/test-manifest-merging new file mode 100755 --- /dev/null +++ b/tests/test-manifest-merging @@ -0,0 +1,34 @@ +#!/bin/sh + +echo % init foo-base +hg init foo-base + +echo % create alpha in first repo +cd foo-base +echo 'alpha' > alpha +hg ci -A -m 'add alpha' -d '1 0' +cd .. + +echo % clone foo-base to foo-work +hg clone foo-base foo-work + +echo % create beta in second repo +cd foo-work +echo 'beta' > beta +hg ci -A -m 'add beta' -d '2 0' +cd .. + +echo % create gamma in first repo +cd foo-base +echo 'gamma' > gamma +hg ci -A -m 'add gamma' -d '3 0' +cd .. + +echo % pull into work and merge +cd foo-work +hg pull -q +hg merge + +echo % revert to changeset 1 to simulate a failed merge +rm -fr * +hg up -C 1 diff --git a/tests/test-manifest-merging.out b/tests/test-manifest-merging.out new file mode 100644 --- /dev/null +++ b/tests/test-manifest-merging.out @@ -0,0 +1,14 @@ +% init foo-base +% create alpha in first repo +adding alpha +% clone foo-base to foo-work +1 files updated, 0 files merged, 0 files removed, 0 files unresolved +% create beta in second repo +adding beta +% create gamma in first repo +adding gamma +% pull into work and merge +1 files updated, 0 files merged, 0 files removed, 0 files unresolved +(branch merge, don't forget to commit) +% revert to changeset 1 to simulate a failed merge +2 files updated, 0 files merged, 0 files removed, 0 files unresolved