Nov 2008
Tue, 25 Nov 2008
Imprint, places I lived
Jan Dittmer
Rankestrasse 17
38102 Braunschweig
jdi@l4x.org
+49 - 531 - 3884123
+49 - 179 - 4570689
Address history
Rankestrasse 17
38102 Braunschweig
jdi@l4x.org
+49 - 531 - 3884123
+49 - 179 - 4570689
Address history
| Click on the addresses to reveal their location. |
posted at: 21:32 | path: / | permanent link to this entry
How to back date a subversion checkin
While setting up a new subversion (svn) repository for my
old blog entries, I wanted to keep the original dates (mtime of
the file) in the checkin commit (for use with the pyblosxom
svn plugin). After a quick online research I came up with the
following script:
#!/bin/sh
# svn-ci-date.sh
# Jan Dittmer <jdi@l4x.org> 2008
# Use at your own risk
#
D=`ls -l "$1" | cut -f6-7 -d' ' | sed 's/ /T/'`
D="${D}:00.000000Z"
echo "Date: $D"
if ! svn add "$1"; then exit 1; fi
if ! svn ci -m "Date $D" "$1"; then exit 2; fi
R=`svn info "$1" | grep "^Revision: " | cut -f2 -d' '`
echo "Revision: $R"
if [ "$R" == "" ]; then exit 3; fi
if ! svn propset --revprop svn:date -r$R "$D"; then exit 4; fi
Please note, that subversion does not do any sanity checking on the
svn:date property. If svn log reports a 'Bogus Date' afterwards, make
sure your dates have the format 'YYYY-MM-DDThh:mm:ss.uuuuuuZ'.
posted at: 20:49 | path: /unix | permanent link to this entry
