Commit Graph

18 Commits

Author SHA1 Message Date
Simon Farnsworth
74ca86ac73 merge: save merge part labels for later reuse
We permit the caller of merge operations to supply labels for the merge
parts ("local", "other", and optionally "base"). These labels are used in
conflict markers to reduce confusion; however, the labels were not
persistent, so 'hg resolve' would lose the labels.

Store the labels in the mergestate.
2016-03-19 18:37:10 -07:00
Durham Goode
4834302703 merge: add file ancestor linknode to mergestate
During a merge, each file has a current commitnode+filenode, an other
commitnode+filenode, and an ancestor commitnode+filenode. The ancestor
commitnode is not stored though, and we rely on the ability for the filectx() to
look up the commitnode by using the filenode's linkrev. In alternative backends
(like remotefilelog), linkrevs may have restriction that prevent arbitrary
linkrev look up given a filenode.

This patch accounts for that by storing the ancestor commitnode in
the merge state so that it is available later at resolve time.

This results in some test changes because the ancestor commitnode we're using at
resolve time changes slightly. Before, we used the linkrev commit, which is the
earliest commit that introduced that particular filenode (which may not be the
latest common ancestor of the commits being merged). Now we use the latest
common ancestor of the merged commits as the commitnode. This is fine though,
because that commit contains the same filenode as the linkrev'd commit.
2016-02-05 10:22:14 -08:00
timeless
f1102ce465 histedit: limit updated and merging output to important updates
Output is retained when:
* There's a conflict
* User asked to edit
* User aborts

otherwise, output is suppressed
2016-02-03 13:52:04 +00:00
timeless
c5945ca9d0 histedit: list action when intervention is required 2015-12-23 08:57:04 +00:00
timeless
5551448efc histedit: omit useless message from update (histeditaction)
specifically:
0 files updated, 0 files merged, 0 files removed, 0 files unresolved
2015-12-14 21:43:16 +00:00
Siddharth Agarwal
6bdb690f9a debugmergestate: print out null nodes as 'null'
This is so much easier to read than a long string of zeroes, and we're going to
have a lot more of these nodes once change/delete conflicts are part of the
merge state.
2015-11-30 10:26:37 -08:00
Siddharth Agarwal
4a78a436f9 mergestate: handle additional record types specially
This works around a bug in older Mercurial versions' handling of the v2 merge
state.

We also add a bunch of tests that make sure that
(1) we correctly abort when the merge state has an unsupported record type
(2) aborting the merge, rebase or histedit continues to work and clears out the
    merge state.
2015-11-18 15:46:45 -08:00
Siddharth Agarwal
a6dc53e738 simplemerge: move conflict warning message to filemerge
The current output for a failed merge with conflict markers looks something like:

  merging foo
  warning: conflicts during merge.
  merging foo incomplete! (edit conflicts, then use 'hg resolve --mark')
  merging bar
  warning: conflicts during merge.
  merging bar incomplete! (edit conflicts, then use 'hg resolve --mark')

We're going to change the way merges are done to perform all premerges before
all merges, so that the output above would look like:

  merging foo
  merging bar
  warning: conflicts during merge.
  merging foo incomplete! (edit conflicts, then use 'hg resolve --mark')
  warning: conflicts during merge.
  merging bar incomplete! (edit conflicts, then use 'hg resolve --mark')

The 'warning: conflicts during merge' line has no context, so is pretty
confusing.

This patch will change the future output to:

  merging foo
  merging bar
  warning: conflicts while merging foo! (edit, then use 'hg resolve --mark')
  warning: conflicts while merging bar! (edit, then use 'hg resolve --mark')

The hint on how to resolve the conflicts makes this a bit unwieldy, but solving
that is tricky because we already hint that people run 'hg resolve' to retry
unresolved merges. The 'hg resolve --mark' mostly applies to conflict marker
based resolution.
2015-10-09 13:54:52 -07:00
Durham Goode
9d87aed6e4 graft: allow creating sibling grafts
Previously it was impossible to graft a commit onto it's own parent (i.e. create
a copy of the commit). This is useful when wanting to create a backup of the
commit before continuing to amend it. This patch enables that behavior.

The change to the histedit test is because histedit uses graft to apply commits.
The test in question moves a commit backwards onto an ancestor. Since the graft
logic now more explicitly supports this, it knows to simply accept the incoming
changes (since they are more recent), instead of prompting.
2015-04-05 11:55:38 -07:00
Siddharth Agarwal
265738b91b resolve: don't abort resolve -l even when no merge is in progress
This broke some internal automation that was quite reasonably checking for
unresolved files as a way to determine whether a merge happened cleanly. We
still abort for resolve --mark etc.
2014-05-23 13:10:31 -07:00
Gregory Szorc
8e5e922c37 resolve: abort when not applicable (BC)
The resolve command is only relevant when mergestate is present.
This patch will make resolve abort when no mergestate is present.

This change will let people know when they are using resolve when they
shouldn't be. This change will let people know when their use of resolve
doesn't do anything.

Previously, |hg resolve -m| would allow mergestate to be created. This
patch now forbids that. Strictly speaking, this is backwards
incompatible. The author of this patch believes creating mergestate via
resolve doesn't make much sense and this side-effect was unintended.
2014-04-18 19:08:32 -07:00
Martin Geisler
7316194bdf tests: don't load unnecessary graphlog extension
Since graphlog is in core, we can use 'hg log -G' instead.
2013-11-22 19:14:17 +01:00
Pierre-Yves David
6397296e45 histedit-test: generalise --commands "-" usage
This is simpler than temporary file version. There some minor test
changes since commit messages are no longer modifed. There is still
some tests using --commands with a real file.
2013-04-16 21:57:25 -05:00
Augie Fackler
45ed657bf8 histedit: switch from util.Abort to util.InterventionRequired where appropriate (bc) 2013-02-08 16:27:49 -06:00
Pierre-Yves David
7053ba6e9e histedit: replaces patching logic by merges
The old and fragile patching logic is replaced by smart merges (as rebase and
graft do). This should prevents some conflicts and smoother human resolution.

For this purpose the "foldchanges" function is renamed to "applychanges" and
handle a single revision only.
2012-09-21 19:27:22 +02:00
Mads Kiilerich
e1e9922b2d tests: make histedit pass on Windows MSYS
The command file will now be named with $TESTTMP (with '\') instead of `pwd`
(with '/') to avoid wrong path conversions.
2012-07-02 01:47:59 +02:00
Mads Kiilerich
9fd035159b tests: make histedit tests more resilient to filesystem variation
Better quoting of odd filesystem paths and no dependency to execute bit.
2012-06-30 03:34:50 +02:00
Mads Kiilerich
db710d2031 tests: convert histedit tests to .t
Mostly a trivial conversion.
2012-06-30 03:34:44 +02:00