[issue3058] qfold followed by qmv silently fails with versioned queue

Lars Westerhoff bugs at mercurial.selenic.com
Thu Oct 20 08:43:51 CDT 2011

New submission from Lars Westerhoff <lars.westerhoff at newtec.eu>:

Folding a patch onto a lower patch followed by renaming the resulting patch
to the name of the previously folded patch fails with versioned queues when
not committing the queue in-between.

For example:
$ hg qapplied
$ hg qfold upper.patch
$ hg qmv upper.patch

results in a upper.patch with a content identical to the one before the two
operations instead of the fold of lower.patch and upper.patch. Thus, the
previous content of lower.patch is completely lost.

Even worse, "hg diff" and "hg qdiff" seem to indicate that all went well,
despite the patch being wrong. So, the problem is only discovered after a
"hg qpop && hg qpush".

When doing the same with a non-versioned queue (i.e. removing the "hg init
--mq" and "hg commit --mq -mpatches" steps in the attached test) everything
works as expected.

I suspect, the "hg qmv" just reverts the "hg rm" on the queue repository
triggered by the "hg qfold" thereby losing the result of the fold. I guess,
it should perform a "hg mv" on the queue repository instead.

A complete test is attached, which FAILS on the current stable branch
(3eb1a90ea409) as described (hg 1.9.1 shows the same behavior).

files: test-qfold-qmv-bug.t
messages: 17689
nosy: lwhoff
priority: bug
status: unread
title: qfold followed by qmv silently fails with versioned queue
topic: 2.0, mq

Mercurial issue tracker <bugs at mercurial.selenic.com>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: test-qfold-qmv-bug.t
Type: text/troff
Size: 1476 bytes
Desc: not available
URL: <http://selenic.com/pipermail/mercurial-devel/attachments/20111020/811b7e97/attachment.bin>

More information about the Mercurial-devel mailing list