color: consolidate cut-and-paste code
This fixes a mild case of cut-and-paste code regarding failing to set
terminal modes. This is evident in the win32 comment that is misplaced
for the terminfo mode since cset
ad6ad51cc0dd.
Instead, we refactor this C&P into a small local function.
record: move parsepatch from record to patch
Part of a series of patches to move record from hgext to core
record: move scanpatch from record to patch
Part of a series of patches to move record from hgext to core
record: move hunk class from record to patch
Part of a series of patches to move record from hgext to core
record: move countChanges in the hunk class
Part of a series of patches to move record from hgext to core
record: move header class from record to patch
Part of a series of patches to move record from hgext to core
cmdutil.tryimportone: allow importing relative patches into the working dir
This makes hg import --prefix dir/ (without bypass) work.