templater: enable alias predicates to be used in "revset()" function
Before this patch, predicates defined in "[revsetalias]" can't be used
in the query specified to template function "revset()", because:
- "revset()" uses "localrepository.revs()" to get query result, but
- "localrepository.revs()" passes "None" as "ui" to "revset.match()", then
- "revset.match()" can't recognize any alias predicates
To enable alias predicates to be used in "revset()" function, this
patch invokes "revset.match()" directly with "repo.ui".
This patch doesn't make "localrepository.revs()" pass "self.ui" to
"revset.match()", because this may be intentional implementation to
prevent alias predicates from shadowing built-in ones and breaking
functions internally using "localrepository.revs()".
Even if it isn't intentional one, the check for shadowing should be
implemented (maybe on default branch) before fixing it for safety.
import: show the warning message for failure of merging
Before this patch, no message is shown for failure of merging at "hg
import".
In such case, merging patch is imported as a normal revision silently,
and it may confuse users.
For simplicity, this patch recommends just using "--exact", even
though importing the merging patch itself is possible without it if:
- the hash of the 1st parent in the patch is equal to one of the
patch imported just before (or the parent of the working
directory, for the 1st patch of the series), and
- the hash of the 2nd parent in the patch is known in the local
repository
graft: fix collision detection with origin revisions that are missing
When grafting something with a matching origin, it would normally be skipped:
skipping already grafted revision 123 (23 also has origin 12)
But after stripping a graft origin, graft could fail with a reference to the
origin that no longer exists:
abort: unknown revision '
5c095ad7e90f871700f02dd1fa5012cb4498a2d4'!
Instead, detect that the origin is unknown and skip it anyway, like:
skipping already grafted revision 8 (2 also has unknown origin
5c095ad7e90f871700f02dd1fa5012cb4498a2d4)