# HG changeset patch # User Patrick Mezard # Date 1285103698 -7200 # Node ID 4ae3e5dffa60ae2843871534cda9c79ed1f340eb # Parent 55dc918c21d5abda3e76b7f3c205a43481dea7c3 context: fix filectx.undelete() (issue2388) diff -r 55dc918c21d5 -r 4ae3e5dffa60 mercurial/context.py --- a/mercurial/context.py Mon Sep 20 17:01:12 2010 -0500 +++ b/mercurial/context.py Tue Sep 21 23:14:58 2010 +0200 @@ -843,7 +843,7 @@ 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 -r 55dc918c21d5 -r 4ae3e5dffa60 tests/test-mq-qrename --- a/tests/test-mq-qrename Mon Sep 20 17:01:12 2010 -0500 +++ b/tests/test-mq-qrename Tue Sep 21 23:14:58 2010 +0200 @@ -36,4 +36,18 @@ 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 -r 55dc918c21d5 -r 4ae3e5dffa60 tests/test-mq-qrename.out --- a/tests/test-mq-qrename.out Mon Sep 20 17:01:12 2010 -0500 +++ b/tests/test-mq-qrename.out Tue Sep 21 23:14:58 2010 +0200 @@ -8,3 +8,10 @@ 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