update: add tests for untracked local file

We don't seem to have any tests for updating to another revision when
there are untracked files on the local side that conflict with the
those on the remote side, so let's add tests. This shows how we
overwrite untracked ignored files when updating to a revision that
tracks the file.

--HG--
branch : stable
extra : rebase_source : 51628254c172765ba878b2cd4a6ea95b6959be6b
extra : histedit_source : 45124ff444a15d4ad25e6e765694275982463742
update: don't overwrite untracked ignored files on update

When looking for untracked files that would conflict with a tracked
file in the target revision (or the remote side of a merge), we
explcitly exclude ignored files. The code was added in 7e30f5f2285f
(merge: refactor unknown file conflict checking, 2012-02-09), but it
seems like only unknown, not ignored, files were considered since the
beginning of time.

Although ignored files are mostly build outputs and backup files, we
should still not overwrite them. Fix by simply removing the explicit
check.

--HG--
branch : stable
extra : rebase_source : 82730e6a5b4ac4f981521fad89c4c7707f2a551a
extra : amend_source : 63fd0b9c0ccd47e98c1869ccf459e8b91c9f3768
extra : histedit_source : 8abaa8c33349ac265c1e09de109add58449d4c85
parsers: ensure revlog index node tree is initialized before insertion

Currently, the revlog index C implementation assumes its node tree will be
initialized before a new element is inserted by revnum. For example, revlog.py
executes 'self.index.insert(-1, e)' in _addrevision(). This is only safe
because the node tree has been initialized by a "node in self.nodemap"
check made in addrevision().

(For context, this was discovered while developing an experimental revlog
mixin which stores "elided nodes" via a separate code path from
_addrevision(); that new code path segfaults without this patch.)
bookmarks: factor out repository lookup from writing bookmarks file

This will allow the share extension to extend bookmarks functionality to share
bookmarks between repositories.
largefiles: don't clobber merge action message with user message

The message in the action is used for debugging and should not be the
same as the question presented to the user. Use a different variable
for the user message, so the 'msg' variable already in scope does not
get overwritten.

--HG--
extra : amend_source : b34f3bb0ea069cff21ab4d3c07b02e982dba1667
largefiles: use clearer debug messages in actions

In overridecalculateupdates(), 'g' (get) actions may be converted into
other actions. In most of these cases, it does not make sense to keep
the action's message. For example, 'remote created' does not make
sense for an 'r' (remove) action.
update: remove redundant and misplaced merge tests

The "nothing to merge" case is covered by test-merge-default.t.

The "uncommitted changes" case is covered by test-merge1.t (and
others).

The "merge -f" case is covered by test-merge-force.t.
merge: branch code into {n1 and n2, n1, n2} top-level cases

There are three high-level cases that are of interest in
manifestmerge(): 1) The file exists on both sides, 2) The file exists
only on the local side, and 3) The file exists only on the remote
side. Let's make this clearer in the code.

The 'if f in copied' case will be broken up into the two applicable
branches in the next patch.
merge: duplicate 'if f in copied' into each branch
merge: don't ignore conflicting file in remote renamed directory

When the remote side has renamed a directory from a/ to b/ and added a
file b/c in it, and the local side has added a file a/c, we end up
moving a/c to b/c without considering the remote version of b/c. Add a
check for this case and use the merge ('m') action in this case
instead of the directory rename ('dm') action.
merge: don't overwrite conflicting file in locally renamed directory

When the local side has renamed a directory from a/ to b/ and added a
file b/c in it, and the remote side has added a file a/c, we end up
overwriting the local file b/c with the contents of remote file
a/c. Add a check for this case and use the merge ('m') action in this
case instead of the directory rename get ('dg') action.
merge with stable