chgserver: create new process group after fork (
issue5051)
This is to make SIGTSTP work. Before the patch, the server process group is
considered "orphaned" and will ignore SIGTSTP, SIGTTIN, SIGTTOU, according to
POSIX. See the comment above `will_become_orphaned_pgrp` in `kernel/exit.c`
from Linux 4.3 for details.
SIGTSTP is important if chgserver runs some ncurses commend like `commit -i`.
Ncurses has its own SIGTSTP handler which will do the following:
1. Clean the screen
2. Stop itself by resending SIGTSTP to itself
3. Restore the screen
If SIGTSTP is ignored, step 2 will be a noop, which means the process cannot
be suspended properly.
In order to make things work, chg client needs to forward SIGTSTP and SIGCONT
to server as well.
check-commit: check for double-addition of blank lines
Previously, we were only checking for a blank line being added next to
an existing one. Now we also check for two being added at the same time.
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.
merge: add debugmergestate support for _stateextras
Now that we can store extras for each file, we need to have support for showing
it in debugmergestate (the tests depend on this).