Ticket #12082: fixdate.sh
File fixdate.sh, 376 bytes (added by , 10 years ago) |
---|
Line | |
---|---|
1 | #!/bin/bash |
2 | |
3 | hg status --all |sed -n 's/^C //p' | \ |
4 | while read file |
5 | do |
6 | date=`hg log $file |sed -n 's/^date: *//; T; s/ \([0-9][0-9]:[0-9][0-9]:[0-9][0-9]\) \([0-9]*\) / \2 \1/p; q;'` |
7 | echo "$date $file" |
8 | touch "--date=$date" $file |
9 | done |
10 | |
11 | find . -type d |tac | \ |
12 | while read dir |
13 | do |
14 | newestfile=`ls -1 -A --sort=time $dir |head -n1` |
15 | touch -r $dir/$newestfile $dir |
16 | done |