Skip to content

Instantly share code, notes, and snippets.

@kenguest
Created January 28, 2014 10:03
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save kenguest/8665000 to your computer and use it in GitHub Desktop.
Save kenguest/8665000 to your computer and use it in GitHub Desktop.
Script to change modification date of file in mercurial to last mod date according to mercurial. Useful for when you do a checkout and want a ls -lart to reflect when files were last changed.
#!/bin/bash
for i in $*
do
date=`hg log -l 1 $i --template '{date|isodate}\n'`
if [ "$date" != "" ] ; then
touch -m --date="$date" $i
else
echo "$i not in hg" > /dev/stderr
fi
done
@kenguest
Copy link
Author

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment