[issue414] cannot rename files with MQ

Benoit Boissinot mercurial-bugs at selenic.com
Fri Nov 3 15:30:06 UTC 2006


New submission from Benoit Boissinot <bboissin at gmail.com>:

Ok, another one resulting resulting in a corrupt repository. A
colleague hg renamed a bunch of files on qtop. This patch was qpopped
to rebase. qpushing then fails and leaves broken patches and local
unmodified changes.

To minimally reproduce:

$ hg init test && cd test
$ hg qnew -m "test" test
$ echo "foo" > foo && hg add
$ hg mv foo bar
$ hg qrefresh
$ cat .hg/patches/test
test

diff --git a/foo b/bar
copy from foo
copy to bar
$ ls
bar  .hg/
$ hg qpop
Patch queue now empty
$ hg qpush
applying test
abort: No such file or directory: /home/asinger/work/test/foo

Since we are refreshing a patch, it should not record the copy
information because the version before it did not have the file.

In my colleagues case, he had many more of these. Also, hg mv fails
even if the file is not new. For example, if the patch before has the
file in a certain place, and the patch on top did an hg mv on it and
qrefreshed, the error still happens.

This resulted in an odd state where the failure created a bunch of
(partial?)  local mods, and all the patches remained unapplied because
they could not be pushed. It was unclear what to do with the local
mods, even if the unapplied patches could be fixed by hand (which
patch should the local mods be folded into, if any? There were too
many mods and patches work out what to do, so he started from
scratch without MQ.)

The above happens when git extended diff is turned on:

[diff]
git = True

----------
messages: 2332
nosy: tonfa
priority: bug
status: unread
title: cannot rename files with MQ
topic: mq

____________________________________________________
Mercurial issue tracker <mercurial-bugs at selenic.com>
<http://www.selenic.com/mercurial/bts/issue414>
____________________________________________________




More information about the Mercurial-devel mailing list