bug: cannot rename files with MQ

Armando Singer armando.singer at gmail.com
Thu Nov 2 20:10:10 CST 2006


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

Thank you,
Armando


More information about the Mercurial mailing list