func (m *MergeAdder) HandleToken(l *lex.Lexer, o io.Writer) error {
	switch l.Token() {
	case lex.CommitTok:
		parser := gitexport.NewLexerParser(l)
		commit, err := parser.Commit()
		if err != nil {
			return err
		}
		parentMark := int(0)
		ok := false
		if commit.Mark != 0 {
			if parentMark, ok = m.MarkToParentMark[commit.Mark]; ok {
				commit.Merge = append(commit.Merge, fmt.Sprintf(":%d", parentMark))
			}
		}
		m.Commits = append(m.Commits, commit)

	case lex.ResetTok:
		if err := m.WriteCommits(o); err != nil {
			return err
		}
		io.WriteString(o, l.Line())
		l.Consume()

	default:
		io.WriteString(o, l.Line())
		l.Consume()
	}
	return nil
}
func (t *TagHarvester) HandleToken(l *lex.Lexer, o io.Writer) error {
	switch l.Token() {
	case lex.TagTok:
		tag := l.Field(1)
		io.WriteString(o, l.Line())
		l.Consume()
		var mark int
		_, err := fmt.Sscanf(l.Line(), "from :%d\n", &mark)
		if err != nil {
			return fmt.Errorf("invalid 'from' line: %s", l.Line())
		}
		t.TagToMark[tag] = mark

		io.WriteString(o, l.Line())
		l.Consume()

	default:
		io.WriteString(o, l.Line())
		l.Consume()
	}
	return nil
}