Commit Graph

8 Commits

Author SHA1 Message Date
Siddharth Agarwal
1c3dcd1546 filemerge: default change/delete conflicts to 'leave unresolved' (BC)
It makes far more sense to leave these conflicts unresolved and kick back to
the user than to just assume that the local version be chosen. There are almost
certainly buggy scripts and applications using Mercurial in the wild that do
merges or rebases non-interactively, and then assume that if the operation
succeeded there's nothing the user needs to pay attention to.

(This wasn't possible earlier because there was no way to re-resolve
change/delete conflicts -- but now it is.)
2015-12-23 12:51:45 -08:00
Siddharth Agarwal
7382fa0a4e filemerge: add a 'leave unresolved' option to change/delete prompts
We're going to make this option the default in an upcoming patch.
2015-11-30 13:43:55 -08:00
Siddharth Agarwal
106338a190 merge: move almost all change/delete conflicts to resolve phase (BC) (API)
We have finally laid all the groundwork to make this happen.

The only change/delete conflicts that haven't been moved are .hgsubstate
conflicts. Those are trickier to deal with and well outside the scope of this
series.

We add comprehensive testing not just for the initial selections but also for
re-resolves and all possible dirstate transitions caused by merge tools. That
testing managed to shake out several bugs in the way we were handling dirstate
transitions.

The other test changes are because we now treat change/delete conflicts as
proper merges, and increment the 'merged' counter rather than the 'updated'
counter. I believe this is the right approach here.

For third-party extensions, if they're interacting with filemerge code they
might have to deal with an absentfilectx rather than a regular filectx.

Still to come:
- add a 'leave unresolved' option to merges
- change the default for non-interactive change/delete conflicts to be 'leave
  unresolved'
- add debug output to go alongside debug outputs for binary and symlink file
  merges
2015-11-25 14:25:33 -08:00
Mads Kiilerich
ec0ae429ed debugdirstate: don't hide date field with --nodate, just show 'set'/'unset'
The value of the dirstate date field cannot be used in tests and we thus have
to use debugdirstate with --nodate. It is however still very helpful to be able
to see whether the date field has been set or still is unset. The absence of
that information made it hard to debug some largefile dirstate issues.

This change _could_ make the test suite more unstable ... but that would be
places where the test suite or the code should be made more stable. (Note:
'unset' with the magic negative sizes is reliable. 'unset' for normal sizes
would probably not be reliable, but there is no such occurrences in the test
suite and it should thus be reliable.)

This output wastes more horizontal space in the --nodate output, but it also
makes things simpler that the output format always is the same. It is just a
debug command so let's keep it simple.
2015-01-09 18:38:02 +01:00
Matt Mackall
8e8234eecc dirstate: merge falls through to otherparent
This lets us more correctly fix the state when we use setparents, as
demonstrated in the change in test-graft.t.
2014-10-11 14:05:09 -05:00
Matt Mackall
f7a8e82c62 dirstate: use 'm' state in otherparent to reduce ambiguity
In rebase-like operations where we abandon the second parent, we can
correctly fix up the state in setparents.
2014-10-10 13:31:06 -05:00
Mads Kiilerich
4aef593d5a merge: don't overwrite file untracked after remove, abort with 'untracked files'
Merge could overwrite untracked files and cause data loss.

Instead we now handle the 'local side removed file and has untracked file
instead' case as the 'other side added file that local has untracked' case:

  FILE: untracked file exists
  abort: untracked files in working directory differ from files in requested revision

It could perhaps make sense to create .orig files when overwriting, either
instead of aborting or when overwriting anyway because of force ... but for now
we stay consistent with similar cases.
2014-02-10 00:43:54 +01:00
Adrian Buehlmann
b48212d057 tests: unify test-merge-remove 2010-09-12 12:11:39 +02:00