[issue835] qpush leaves new files empty when earlier file to modify is missing
mercurial-bugs at selenic.com
Tue Nov 20 02:52:54 CST 2007
New submission from Peter Arrenbrecht <peter.arrenbrecht at gmail.com>:
hg init a
echo one >one
hg ci -m "one"
# Create patch modifying "one" and adding "two".
hg qnew two.patch
echo two >two
echo more >>one
# Pop the patch, remove "one", then repush the patch.
hg rm one
hg ci -m "-one"
hg qpush -v
The output of "qpush" is:
unable to find one or one for patching
Errors during apply, please fix and refresh two.patch
qpush-test/one: No such file or directory
one not tracked!
patch failed, rejects left in working dir
"two" is now empty, but the message suggests I just need to fix the problem with
"one" and then refresh. Since "one" is gone, I'll just ignore it and qrefresh.
Now I lose the contents of "two" *in the patch*.
A reasonable approach might be to make patch.applydiff catch PatchErrors and
continue with the next file. If this is not an option, then at least "two"
should not get added (with misleading success messages) and it should not get
created. It does get created right now after the patch failed by patch.updatedir at:
if ctype == 'ADD' and not os.path.exists(dst):
repo.wwrite(gp.path, '', x and 'x' or '')
title: qpush leaves new files empty when earlier file to modify is missing
Mercurial issue tracker <mercurial-bugs at selenic.com>
More information about the Mercurial-devel