Commit Graph

19 Commits

Author SHA1 Message Date
Augie Fackler
bc9dc896c1 test-resolve.t: use redirection to /dev/null instead of grep -q 2014-10-17 11:01:05 -04:00
Martin von Zweigbergk
6d828e9c66 resolve: run happily after conflict-free merge 2014-10-08 22:30:04 -07:00
Martin von Zweigbergk
3fff17492d test-resolve: add tests for re-merge 2014-10-08 22:16:18 -07:00
Martin von Zweigbergk
9791d9b4dc test-resolve: add more tests for in conflict-free states
We already have a test for 'hg resolve -m' when there is no merge in
progress. Add one for 'hg resolve --all' as well.

Also add tests for both --all and -m when there is a merge without
conflicts in progress. They should both be successful, just as if
there had been conflicts that had been marked resolved. However, that
is currently broken, so mark the tests broken for now. The behavior
will be fixed in a later patch.
2014-10-08 22:19:08 -07:00
Martin von Zweigbergk
1645eb5e43 test-resolve: add test resolving one of two files
The tests for resolve are missing a lot of cases. Let's start by
adding another file to the test repo, so we can test resolving one of
two files.
2014-10-08 21:07:30 -07:00
Martin von Zweigbergk
362a7efc7a test-resolve: clarify test descriptions and consistently use "should" 2014-10-08 21:19:31 -07:00
Pierre-Yves David
3efa776f85 resolve: add parenthesis around "no more unresolved files" message
This message may be confused with an error message. Adding parenthesis around it
will make it more recognisable as an informative message.
2014-07-26 03:32:49 +02:00
Matt Mackall
140901211f resolve: fix grammar of no matching files message 2014-06-09 14:11:17 -05: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
Matt Mackall
0cb0a7ba67 resolve: simplify "finished" message
The recently introduced message was:

  no unresolved files; you may continue your unfinished operation

This had three problems:

- looks a bit like an error message because it's not saying "we've
  just resolved the last file"
- refers to "unfinished operation", which won't be the case with
  "update" or "merge"
- introduces semicolons to error messages, which is stylistically
  questionable

I've simplified this to:

  no more unresolved files

In the future, if we want to prompt someone to continue a particular operation, we should use
a hint style:

  no more unresolved files
  (use 'hg graft --continue' to finish grafting)
2014-05-09 14:46:50 -05:00
Gregory Szorc
85e363fea8 resolve: print message when no unresolved files remain (issue4214)
When using resolve, users often have to consult with the output of |hg
resolve -l| to see if any unresolved files remain. This step is tedious
and adds overhead to resolving.

This patch will notify a user if there are no unresolved files remaining
after executing |hg resolve|::

    no unresolved files; you may continue your unfinished operation

The patch stops short of telling the user exactly what command should be
executed to continue the unfinished operation. That is because this
information is not currently captured anywhere. This would make a
compelling follow-up feature.
2014-04-18 22:19:25 -07:00
Gregory Szorc
3f06fc8ed0 resolve: print warning when no work performed (issue4208)
Previously, if the paths specified as arguments to |hg resolve| were
invalid, they were silently ignored and a no-op would ensue.

This patch fixes that in some scenarios.

If none of the paths specified to |hg resolve| match a path that is in
mergestate, a warning will be emitted.

Ideally, a warning would be emitted for every path/pattern specified
that doesn't match anything. To achieve this would require significant
refactoring of the matching subsystem. That work is beyond the scope of
this patch series. Something is better than nothing and this patch
gets us something.
2014-04-18 18:56:26 -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
Gregory Szorc
2ec67abea0 resolve: split test
Part of test-resolve.t is split into multiple tests to create an
injection point for new tests that will be added in subsequent patches.
2014-04-18 18:26:42 -07:00
Mads Kiilerich
fa1c4e5ebe tests: add missing trailing 'cd ..'
Many tests didn't change back from subdirectories at the end of the tests ...
and they don't have to. The missing 'cd ..' could always be added when another
test case is added to the test file.

This change do that tests (99.5%) consistently end up in $TESTDIR where they
started, thus making it simpler to extend them or move them around.
2012-06-11 01:40:51 +02:00
Steve Borho
a3baf6a2e7 merge: implement --tool arguments using new ui.forcemerge configurable
ui.forcemerge is set before calling into merge or resolve commands, then unset
to prevent ui pollution for further operations.

ui.forcemerge takes precedence over HGMERGE, but mimics HGMERGE behavior if the
given --tool is not found by the merge-tools machinery.  This makes it possible
to do:  hg resolve --tool="python mymerge.py" FILE

With this approach, HGMERGE and ui.merge are not harmed by --tool
2010-10-19 22:33:52 -05:00
Matt Mackall
08439e0f2d tests: add exit codes to unified tests 2010-09-16 17:51:32 -05:00
Brodie Rao
4be7b3bfc3 merge: suggest 'hg up -C .' for discarding changes, not 'hg up -C'
Without specifying the parent revision of the working copy, users will
update to tip, which is most likely the other head they were trying to
merge, not the revision they were at before the merge.
2010-09-12 18:05:53 -05:00
Nicolas Dumazet
4f017eca36 tests: unify test-resolve 2010-08-30 14:06:18 +09:00