#!/usr/local/bin/python2.7
# Copyright 2005, 2006 by Simon 'corecode' Schubert <corecode@fs.ei.tum.de>
#
# This program is free software under the GNU GPL (>=v2)
# Read the file COPYING coming with the software for details.

import sys
from cvstohg import CvsToHg

def printfn(s):
    print s

if len(sys.argv) == 5:
    cvstohg = CvsToHg(sys.argv[1], sys.argv[2], sys.argv[4], printfn)
    cvstohg.sync(sys.argv[3])
elif len(sys.argv) == 4:
    cvstohg = CvsToHg(sys.argv[1], sys.argv[2], sys.argv[3], printfn)
    cvstohg.sync()
else:
    print >>sys.stderr, "Usage: cvs20hg /path/to/cvs/repo module [tag] /path/to/hg/repo\n"
    sys.exit(1)
