Bug in hg qnew/qpop/qpush?

Peter Arrenbrecht peter.arrenbrecht at gmail.com
Fri Sep 7 04:01:27 CDT 2007


Hi all,

Something rather unpleasant just happened (hg 0.9.4). I was working on
a change and realized - yes, once more - that I had started mixing
things. So I wanted to put some of the changes into a patch like so:


peo at pearwood:~/dev/afc/dev$ hg stat
M components/compiler/src/build/java/org/formulacompiler/compiler/internal/build/rewriting/RewriteRulesCompiler.java
M components/compiler/src/impl/java/org/formulacompiler/compiler/internal/bytecode/ExpressionCompiler.java
M components/compiler/src/impl/java/org/formulacompiler/compiler/internal/expressions/LetDictionary.java
M components/compiler/src/test/java/org/formulacompiler/compiler/internal/bytecode/compiler/LittleLanguageTest.java
M components/system/src/test-reference/java-debug/org/formulacompiler/tests/reference/DebugTest.java

peo at pearwood:~/dev/afc/dev$ hg qnew -m "Test for illegal name reuse in
inner lets." let-name-collision-test.patch -I none -f
-I: No such file or directory
-f: No such file or directory
none: No such file or directory


I realize now that I probably should have ordered the options to hg
qnew differently (why, though?). However, what follows means I nearly
lost my changes:


peo at pearwood:~/dev/afc/dev$ hg qtop
let-name-collision-test.patch

peo at pearwood:~/dev/afc/dev$ hg qdiff
diff --git a/components/compiler/src/build/java/org/formulacompiler/compiler/internal/build/rewriting/RewriteRulesCompiler.java
b/components/compiler/src/build/java/org/formulacompiler/compiler/internal/build/
... the diff is here properly ...

peo at pearwood:~/dev/afc/dev$ hg stat

peo at pearwood:~/dev/afc/dev$ hg qpop
Patch queue now empty

peo at pearwood:~/dev/afc/dev$ hg stat

peo at pearwood:~/dev/afc/dev$ hg qpush
applying let-name-collision-test.patch
/usr/bin/patch: **** Only garbage was found in the patch input.
patch failed, unable to continue (try -v)
patch let-name-collision-test.patch is empty
Now at: let-name-collision-test.patch

peo at pearwood:~/dev/afc/dev$ cat .hg/patches/let-name-collision-test.patch
Test for illegal name reuse in inner lets.

So it appears the patch file is empty, but the changes I made were
properly shown by "hg qdiff" and removed by "hg qpop", they were also
removed from "hg stat" after the "hg qnew"!

Luckily, I still had the scroll buffer of the session and, thus, the
output from "hg qdiff" to restore my changes.

Sounds like a bug, no?
-peo


More information about the Mercurial mailing list