# HG changeset patch # User Patrick Mezard # Date 2010-09-21 21:14:58 # Node ID 4ae3e5dffa60ae2843871534cda9c79ed1f340eb # Parent 55dc918c21d5abda3e76b7f3c205a43481dea7c3 context: fix filectx.undelete() (issue2388) diff --git a/mercurial/context.py b/mercurial/context.py --- a/mercurial/context.py +++ b/mercurial/context.py @@ -843,7 +843,7 @@ class workingctx(changectx): if self._repo.dirstate[f] != 'r': self._repo.ui.warn(_("%s not removed!\n") % f) else: - fctx = f in pctxs[0] and pctxs[0] or pctxs[1] + fctx = f in pctxs[0] and pctxs[0][f] or pctxs[1][f] t = fctx.data() self._repo.wwrite(f, t, fctx.flags()) self._repo.dirstate.normal(f) diff --git a/tests/test-mq-qrename b/tests/test-mq-qrename --- a/tests/test-mq-qrename +++ b/tests/test-mq-qrename @@ -36,4 +36,18 @@ hg qrename y hg qcommit -m rename cd .. - +echo '% test overlapping renames (issue2388)' +hg init c +cd c +hg qinit -c +echo a > a +hg add +hg qnew patcha +echo b > b +hg add +hg qnew patchb +hg ci --mq -m c1 +hg qrename patchb patchc +hg qrename patcha patchb +hg st --mq +cd .. \ No newline at end of file diff --git a/tests/test-mq-qrename.out b/tests/test-mq-qrename.out --- a/tests/test-mq-qrename.out +++ b/tests/test-mq-qrename.out @@ -8,3 +8,10 @@ baz new/dir .hg/patches/new/dir % test patch being renamed before committed +% test overlapping renames (issue2388) +adding a +adding b +M patchb +M series +A patchc +R patcha