patch: include flag-only file changes in "special" when filtering (
issue5864)
This patch fix the
issue5864 (or maybe
issue5865 too) which occurs during
split (or I should say at the time of filtering the hunks in interactive
mode) where user hits a not ending loop of "no changes to record".
And it's not only the case for split it will happen in every interactive
case for e.g. `hg commit -i` or `hg uncommit -i`
After looking into code I found that when filtering we have some
notation called "special" for the file headers which doesn't contain
any hunk and just contain the header (for e.g. newly added empty file
or deleted file) where the user cannot change the content of operation.
And I think we can put this "flag-only" file change in that same bucket
of "special". But I doubt a bit about the case when a file have flag change
and atleast one hunk then user won't be able to separate the flag change
from hunks.
Changed test file reflect the fixed behaviour.
Differential Revision: https://phab.mercurial-scm.org/D6058
https://bz.mercurial-scm.org/619
$ hg init
$ echo a > a
$ hg ci -Ama
adding a
$ echo b > b
$ hg branch b
marked working directory as branch b
(branches are permanent and global, did you want a bookmark?)
$ hg ci -Amb
adding b
$ hg co -C 0
0 files updated, 0 files merged, 1 files removed, 0 files unresolved
Fast-forward:
$ hg merge b
1 files updated, 0 files merged, 0 files removed, 0 files unresolved
(branch merge, don't forget to commit)
$ hg ci -Ammerge
Bogus fast-forward should fail:
$ hg merge b
abort: merging with a working directory ancestor has no effect
[255]
Even with strange revset (issue4465)
$ hg merge ::.
abort: merging with a working directory ancestor has no effect
[255]