Of course, you can automate all this in a small bash script:
You get the file modification date through stat -c %y ${FILENAME} . Thus, assuming the files are ordered:
hg init for i in /path/to/old/versions/*.py do; cp $i . hg ci -d `stat -c %y $i` -m "Import $i" done
Um, the natural sorting of the file name is prog1, prog11, prog12, ... prog19, prog2, prog21, .... You might want to rename prog1 to prog01, etc., to allow normal sorting or sorting of file names before processing them , eg:
hg init for i in `ls -tr /path/to/old/versions/*.py` do; cp /path/to/old/versions/$i . hg ci -d `stat -c %y /path/to/old/versions/$i` -m "Import $i" done
source share