MQ: .rej for missing files not reported if some of them can be manually resolved
Created originally on Bitbucket by psuter (Peter Suter)
Scenario 1
(For comparison, everything is fine here.)
hg init .
echo a>a
hg add a
hg commit -m "a"
echo edit>>a
hg qnew edit.patch
hg qpop
hg rename a b
hg commit -m "a->b"
Now a hg qpush
on the command line would show:
applying edit.patch
unable to find 'a' for patching
1 out of 1 hunks FAILED -- saving rejects to file a.rej
patch failed, unable to continue (try -v)
patch failed, rejects left in working directory
errors during apply, please fix and refresh a.patch
This is fine.
And doing the equivalent in TortoiseHG (right click edit.patch and select "Apply patch") displays the same in a messagebox. This is also good.
Scenario 2
(Not everything is OK here in my opinion.)
hg init .
echo a>a
echo x1>x
echo x2>>x
echo x3>>x
echo x4>>x
hg add a
hg add x
hg commit -m "a"
echo edit>>a
echo x1>x
echo x2>>x
echo edit>>x
echo x3>>x
echo x4>>x
hg qnew edit.patch
hg qpop
hg rename a b
echo y1>x
echo y2>>x
echo y3>>x
echo y4>>x
hg commit -m "a->b"
Now a hg qpush
on the command line would show:
applying edit.patch
unable to find 'a' for patching
1 out of 1 hunks FAILED -- saving rejects to file a.rej
patching file x
Hunk #1 FAILED at 0
1 out of 1 hunks FAILED -- saving rejects to file x.rej
patch failed, unable to continue (try -v)
patch failed, rejects left in working directory
errors during apply, please fix and refresh edit.patch
Again this is fine. Everything is fine so far.
But now doing the equivalent in TortoiseHG (right click edit.patch and select "Apply patch") does not display the same information in a messagebox. Instead it shows:
---------------------------
Manually resolve rejected chunks?
---------------------------
x had rejected chunks, edit patched file together with rejects?
---------------------------
Yes No
---------------------------
Clicking yes opens the reject UI dialog showing x. By itself this is fine.
But a.rej
is never mentioned here, even though scenario 1 and 2 are identical in respect to the file a! This is not good in my opinion.
In scenario 1 the tool informed the user about a.rej
. So the user gets used to that and starts relying on it, handles all conflicts presented and deletes all .rej files.
In scenario 2 the tool also informs the user about x.rej
. The user gets the impression that all conflicts were presented and resolved manually. And deletes all .rej files. But a.rej was not presented and not handled, so the changes to a
are lost!